OpenGL - triangles n' normals

Started by
2 comments, last by Gary_80 12 years, 10 months ago
Hi,

if i have a cube face i.e

0---------------------1
| |
| |
| |
| |
2---------------------3

preferable i want it as two triangles with a diagonal splitting the middle,
my question is is does it mater which way the diagonal goes, and how would the triangles be ordered i.e. 0,1,2 and 213,

Also does the ordering effect the light once the normals has been calculated?

thanks :)
Advertisement
It doesn't matter. Rendering & light will be same no matter in what order you render triangles.
The order of triangles and the direction of diagonal are not important.
The order of vertices of triangle - clockwise or counterclockwise - is. At least if you are rendering solid body (and normally you are). One side of the triangle is facing outside the body, the other inside. Normally the inside facing triangles are discarded by culling.
If you calculate the normal by taking cross product of two side-vectors of the triangle, the direction of the normal also depends on the order of vertices.
Keep all your triangles in counter-clockwise order if looked from outside, and everything should be OK.
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/
ideal, thanks MartinsM

This topic is closed to new replies.

Advertisement