PDA

View Full Version : onthefly Objects need shading


shivanangel
07-17-2008, 09:34 AM
Hello,

I've been creating several algorithms to create 1-D and 2-D data visualizations
from imported CSV data.

I ran into a little bit of a snag today, I created a plot of 2D data but it keeps
coming out completely washed out white.

Is there a simple enable call I can use to set some OpenGL state?

I tried using viz.enable(viz.FLAT) and viz.enable(viz.SMOOTH)
but nothing happened.

Any suggestions?

Thanks for your time,
George L.

farshizzo
07-17-2008, 10:56 AM
You will need to enable lighting on the object:node.enable(viz.LIGHTING)However, if you are creating the polygons using On-The-Fly objects you will need to specify per vertex normals for the lighting to look correct. This means before each viz.vertex call you will need to specify the normal vector of that vertex using the viz.normal command.

shivanangel
07-17-2008, 11:29 AM
Thanks for the help,
I'll look up how to calculate vertex normals so that
my objects have correct lighting.

~George L.