Skip to main content

Shape3D object not receiving lighting

3 replies [Last post]
Randron
Offline
Joined: 2012-07-03
Points: 0

I created a Shape3D object (a rectangle) out of a QuadArray, and it is behaving as though it has no Material, even though I gave it one set many of its properties.

I followed these steps:
-created a QuadArray with 4 points so as to form a rectangle.
-created an Appearance object
-created a Material object, and set its ambient color to bright red, its diffusive color to dark red, and its specular color to black.
-Set the appearances material to the one above, and then created a new Shape3d with its geometry being the QuadArray and its appearance being the one above.
-Added this Shape3D to a TransformGroup containing two spheres(Primitives) and a directional white light. All three objects are easily within range of the light's bounding sphere.

The lighting works perfectly on the spheres, which have their Material set to default values. However, the rectangle appears as one solid color, with no lighting effects. If I change its material's ColorAttributes, that works fine. Its as if its lighting is disabled, but I even setEnableLighting(true) for the material.

Is there some crucial step im missing here in order to make lighting work for this Shape3D?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
razkolnikov
Offline
Joined: 2012-07-03
Points: 0

sup dawg!! sorry to hear about your troubles, bro----maybe one of these will help?

http://stackoverflow.com/questions/2245253/java-3d-unable-to-get-shape3d...

http://stackoverflow.com/questions/4657504/java3d-lighting-problem

best of luck on your game,

Razkolnikov

Randron
Offline
Joined: 2012-07-03
Points: 0

Thanks I got it now.

okelly4408
Offline
Joined: 2012-08-12
Points: 0

Sorry for not replying with anything useful but may I ask how you fixed your issue?