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

Lighting dont work properly cause of normals, what values?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey I''ve got a square made of 4 points using TriangleStrip. When I bring my point light right up to it, it doesn''t light up. But my meshes that are right next to the square light up as i have called ComputeNormals on them. So I believe the problem is with the values i assigned to my normals for the four vertices. heres what my normals are.
ac.vertices3D[0].normal  = D3DXVECTOR3(0,1,0);
ac.vertices3D[1].normal  = D3DXVECTOR3(0,1,0);
ac.vertices3D[2].normal  = D3DXVECTOR3(0,1,0);
ac.vertices3D[3].normal  = D3DXVECTOR3(0,1,0);
what do you suggest i set my normals as? What i want is just for the light to be reflected back, so if i got a point light right next to my square i can see it, if im looking at it from any angle facing it.

Share this post

Link to post
Share on other sites
You''ve got your normals along the y-axis, I think what your looking for is (0,0,-1) for all vertices, that will (in a left handed system, which is what d3d uses) make your face "point" (for want of a better word) towards the negative z axis..


Share this post

Link to post
Share on other sites