D3DFVF_NORMAL, d3d
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)
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*
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*
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
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
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
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
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_
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_
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?!?!
Neil
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement