CollisionTreeExample - Displaying Colours LightState Disable

Problems building or running Ardor3D, questions about how to use features, etc.

CollisionTreeExample - Displaying Colours LightState Disable

Postby gmseed » Thu May 03, 2012 10:06 am

Hi

The light-state in the CollisionTreeExample example is set to false and we see the colours of the objects and collisions:

Code: Select all
    protected void initExample() {
        _lightState.setEnabled(false);


If we enable the light-state we only see a gray-scaled model:

Code: Select all
    protected void initExample() {
        _lightState.setEnabled(true);


How do we view the colours with light-state enabled?

Graham
gmseed
regular
 
Posts: 117
Joined: Tue Jan 03, 2012 3:53 pm

Re: CollisionTreeExample - Displaying Colours LightState Dis

Postby renanse » Thu May 03, 2012 10:21 am

See BoxExample:

Code: Select all
        // Add a material to the box, to show both vertex color and lighting/shading.
        final MaterialState ms = new MaterialState();
        ms.setColorMaterial(ColorMaterial.Diffuse);
        box.setRenderState(ms);


When lighting is enabled, colors come from your MaterialState instead of vertex colors. But if you setup your MaterialState as above, it will pass through the vertex colors for the given property (Diffuse, Ambient, etc.)
Gratitude is a mark of a noble soul and a refined character.
User avatar
renanse
Site Admin
 
Posts: 2958
Joined: Tue Oct 28, 2008 6:49 pm
Location: Austin, TX

Re: CollisionTreeExample - Displaying Colours LightState Dis

Postby gmseed » Fri May 04, 2012 2:07 am

Hi

Thanks for your reply - that resolved the problem.

Graham
gmseed
regular
 
Posts: 117
Joined: Tue Jan 03, 2012 3:53 pm


Return to HELP!

Who is online

Users browsing this forum: No registered users and 1 guest