Archived

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

D3DFVF_NORMAL, d3d

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

Recommended Posts

Why do I need D3DFVF_NORMAL when I use lightning? I understand that it is used to know which direction the light is reflected. But in which way is this normal different from the one d3d uses to know which side of the surface to draw (when using culling). Or better, how do you calculate the values by yourself? Or am I compeltely wrong about this? Thanks plenty! zilch_ (newbie)

Share on other sites
AFAIK, this is the normal per vertex, not per triangle as D3D uses to deside what triangles to draw.

One vertex can be used by multiple triangles, and the vertexnormal for this point is the average normal for the planes that uses this vertex.

Please correct me if I''m wrong
*still a beginner*

Share on other sites
AFAIK D3D doesn''t use normals for backface culling. The graphics card does it in 2D by looking at the winding order (thus the clockwise vs counterclockwise dependence - if the culling were done with a stored normal that wouldn''t be necessary).

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share on other sites
Thanks,
but how do I calculate it?

All I have is the x, y, z and the color. How do I calculate the normal on each vertex then?

thanks

Share on other sites
Ok,
I can see how I can manually insert the normals there. I have looked at some examples. But if I have a complex model? There must be a way to calculate it... isn''t there? :-)

zilch_

Share on other sites
If you are using D3DX Meshes there is a function I believe is called D3DXComputeNormals(). Otherwise it''s a slow old hog at load time but worth it for the lighting.....

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

1. 1
Rutin
26
2. 2
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 14
• 11
• 11
• 9
• Forum Statistics

• Total Topics
631757
• Total Posts
3002135
×