Archived

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

Quad normals problem

This topic is 5018 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

I''m having problems making a very simple quad with lights. I have 4 vertices and the normals are stored in a D3DXVECTOR3. My 4 vertices are arranged as : -1, 0, -1 -1, 0, 1 1, 0, -1 1, 0, 1 and when I finally got it working (the whole triangle lit) these are my normals: 1, 0, 1 1, 0, -1 -1, 0, 1 -1, 0, -1 My question is why are my normals pointing in the opposite direction of my position? I''m using the left handed system. Thanks! /* I use DirectX 8.1 and C++ (Microsoft Visual C++ 6.0 Professional edition) */

Share this post


Link to post
Share on other sites
I don''t quite fully understand normals yet so I don''t know. It is fully lit and the correct color and everything. If I set all of the y values of a the normals it stays lit. Its a flat plane across the z (like a terrain) axis.

/*
I use DirectX 8.1 and C++ (Microsoft Visual C++ 6.0 Professional edition)
*/

Share this post


Link to post
Share on other sites
the normal is a vector perpendicular to the triangle. for example if have some triangles that form a flat terrain, all their normals should point up on the y axis.
normals are used for lighting, but did you set up the light and the material? when you say "the quad is fully lit and shows the correct color", this makes me think that you have not set up lighting properly, maybe you have just set a vertex color, so you will always see that color no matter how you place the normals

Share this post


Link to post
Share on other sites
I beleive I have the lighting set up right because it works fine on models. I haven't set a color to it I set a texture (no material). Before I used those values it was all black. Thanks

/*
I use DirectX 8.1 and C++ (Microsoft Visual C++ 6.0 Professional edition)
*/

[edited by - Programmer16 on March 19, 2004 11:26:45 PM]

Share this post


Link to post
Share on other sites