WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   onthefly Objects need shading (https://forum.worldviz.com/showthread.php?t=1568)

shivanangel 07-17-2008 09:34 AM

onthefly Objects need shading
 
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:
Code:

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.


All times are GMT -7. The time now is 06:45 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC