coin3d / coin

Coin3D core library
BSD 3-Clause "New" or "Revised" License
271 stars 105 forks source link

How to use coin3d draw shadow #79

Closed VolkerEnderlein closed 9 years ago

VolkerEnderlein commented 9 years ago

Original report by ptwaixingren (Bitbucket: ptwaixingren, GitHub: ptwaixingren).


Hi everyone, I want to use Coin3D draw the shadow of a cube, I create a light node and add the node before the cube node.I used the SoShadowGroup too, but there was't shadow. I also install the newest Nvidia driver to insure the opengl version > 2.0. Can anyone tell me how can I draw the shadow?

VolkerEnderlein commented 9 years ago

Original comment by Roy Walmsley (Bitbucket: walroy, GitHub: walroy).


Hi,

You need to incorporate a SoShadowGroup node into your scene graph.

Roy

VolkerEnderlein commented 9 years ago

Original comment by Roy Walmsley (Bitbucket: walroy, GitHub: walroy).


Can you append a copy of your scenegraph (.iv or .wrl file). If you are creating it directly in code you could use a SoWriteAction to output the scene to a file.

Roy

VolkerEnderlein commented 9 years ago

Original comment by Thomas Moeller (Bitbucket: TheHubbit, GitHub: TheHubbit).


Hi ptwaixingren,

The example code in the SoShadowGroup class reference should produce shadows on the floor (something similar to this scene / result). If it doesn't then your graphics card might indeed be unsupported. The example works fine for me on NVIDIA and Intel chips.

Thomas

VolkerEnderlein commented 9 years ago

Original comment by ptwaixingren (Bitbucket: ptwaixingren, GitHub: ptwaixingren).


Thank you TheHubbit, I test as the scene file you told me. and produce shadows on the floor

VolkerEnderlein commented 9 years ago

Original comment by Roy Walmsley (Bitbucket: walroy, GitHub: walroy).


Hi ptwaixingren

Have you now solved your original problem?

Roy

VolkerEnderlein commented 9 years ago

Original comment by Roy Walmsley (Bitbucket: walroy, GitHub: walroy).


This issue was one of usage and not code change. With no further comments this issue is being closed with no further action.