PDA

View Full Version : Viewing edges in 3D object



Ramesh
11-30-2000, 05:53 AM
I drew a cube and filled with some color. But I am not able see its edges. How can I solve it.
thanks

Moz
11-30-2000, 06:05 AM
If you don't enable lighting, you won't see anything but its silhouette.
Unless you draw each face with a different color (or use a texture).

Moz

Ramesh
11-30-2000, 06:10 AM
I do not want to draw each face with different color. I enabled light. But I could not see faces as separate. Is light direction is imp?

Moz
11-30-2000, 06:28 AM
Do you define normal vectors ?

Ramesh
11-30-2000, 06:38 AM
YES I defined normal vectors. I took some example on net and looking into it. When I apply different colors for each face I can see it as cube. But when I buld complex model with several polygons(asume as mesh on 3D object), i should have color control and visibility. Any ideas?

Moz
11-30-2000, 07:05 AM
In what color does the cube appear, what material properties did you set and what are the colors and position of your light ?
(I'm thinking it might be due to saturation)

Ramesh
11-30-2000, 07:09 AM
I need to see position of light. What is material properties. Let me see light position first.

Moz
11-30-2000, 07:17 AM
You need to set material properties to get proper lighting, the color you set with glColor is not used for lighting (well, unless you use glEnable(GL_COLOR_MATERIAL), but you'd rather use glMaterial first to get used to it).
Chapter 5 of the red book for your lighting lesson of the day : http://helios.scripps.edu/cgi-bin/infosr...OpenGL_PG/10431 (http://helios.scripps.edu/cgi-bin/infosrch.cgi?cmd=getdoc&coll=0650&db=bks&fname=/SGI_Developer/OpenGL_PG/10431)

Ramesh
11-30-2000, 07:29 AM
Thank you very much. I will look into it.