#### Archived

This topic is now archived and is closed to further replies.

# Normals and D3D DrawPrimitive

This topic is 6942 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Does the normal determine which "side" of a polygon is visible? And if so, should the following polygon be visible on screen? 0,0 to 1,0 squared with z = 0 normal 0,0,-1 with the camera pointing towards 0,0,0 from 0,0,-50 I can draw the polygons, and I can see them, but only from one direction. But if I switch the normal to 0,0,1, the poly''s don''t spin around. They stay the same.

##### Share on other sites
normals for lighting (and the like).

to have the poly face the other side you have to define the poly in a different order.

Look at the triangle tutorial included in the sdk [under samples\multimedia\d3dim\tutorials\traignle] or something like that. They define a triangle that is visible on both sides (which is two triangles really).

##### Share on other sites
duh. Flipped them around and they work great. Thanks for your time!

##### Share on other sites
another way to do it is by turning backface culling off (somewhere in those renderstate flags)

"Your thoughts are the reality, the phisical side is the illusion"

##### Share on other sites
hey Queasy,Normals are also used for BackFace Culling.

##### Share on other sites
Esap, I doubt it. The normals don''t make a difference in the side that is displayed. The order that the polygons are displayed (i.e. clockwise or ccw) makes a difference.

altair
altair734@yahoo.com
biggins.mit.edu/altair734

##### Share on other sites
You are both right.

The normals defined in the vertices are only used for light calculations, environment mapping etc. But not backface culling.

However, when Direct3D or OpenGL does the backface culling they compute the triangle normal as the crossproduct of two of the triangles edges. This normal is then used when testing if the camera is in front of the triangle or behind it. Since the direction of the crossproduct depends on the order of its arguments the order of the triangles vertices desides which side of the triangle is front or back.

WitchLord

• 15
• 13
• 35
• 39