Skip to main content
GameDev.net gamedev.net
🔒 Locked

Problem getting polygons to draw

Started by flaXen Dec 3, 2001 at 9:31 PM 0 replies 150+ views
Original Post
flaXen
flaXen
I''m having a problem getting polygons to draw when I switch to surface normals instead of RHW. #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW|D3DFVF_TEX1|D3DFVF_DIFFUSE) #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_TEX1|D3DFVF_DIFFUSE|D3DFVF_NORMAL) Originally, I used the first constant as my FVF with RHW always set to 1.0f for each vertex; and all my polygons would draw. The problem is, they''d never take on lighting what-so-ever. So I get functioning vertex normals calculated (as best I can tell it funcions anyway), and I switch to the 2nd constant because you can''t mix D3DFVF_XYZRHW with D3DFVF_NORMAL. I store the normals in the proper place, but polygons don''t draw any more at all. I even turned off culling and the z-buffer, but not so much as a pixel is being drawn. Does anyone have any idea what the problem is and why is it happening? Any clues? All the x/y/z coordinates of the vertices are positive 0-based integers relative to the top-left corner of the screen. Thanks in advance, -- Dan
RomanR
RomanR
XYZRHW means you were using transformed vertices which are not affected by lighting. Now that you are using "untransformed" vertices you need to set up your Projection and View matrix to get proper 3d scene.
Romanroman_rodov@hotmail.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.