Quad normals problem

Started by
3 comments, last by Programmer16 20 years ago
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) */
Advertisement
are you sure your quad is correctly lit? i think its not. all 4 normals should be orthogonal to the quad (0,1,0)
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)
*/
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
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]

This topic is closed to new replies.

Advertisement