Archived

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

D3DFVF_NORMAL

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

Hi, I have a basic question. I understand vertex position is calculated in GPU by g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld ); So it moved somewhere... What about normal vector when I use D3DFVF_NORMAL flag. Is it also calculated every frame in GPU by matWorld ? If so, I don't have to re-calculate normal vector every frame when object move. It is TLVertex ? [edited by - tsurudome on March 24, 2004 7:05:49 AM] [edited by - tsurudome on March 24, 2004 7:07:28 AM]

Share this post


Link to post
Share on other sites
mat world is just a matrix

u set the whole vertex stuff manually, and the normals are usually -1,-1,-1


the matrix just moves stuff for you while its already set, you can''t modify vertices using a matrix, just move and rotate, scale etc on how it is already set


just imagine matrices moving objects only

Share this post


Link to post
Share on other sites
quote:
Original post by johnnyBravo
mat world is just a matrix

u set the whole vertex stuff manually, and the normals are usually -1,-1,-1



I think he knows that it''s a matrix... and -1,-1,-1 isn''t a valid normal, never mind a usual one. There isn''t a usual normal.

To tsurudome, yes the world transform transforms the normals too. The translation is ignored. If you use scaling in your world matrix you will need to set renderstate D3DRS_NORMALIZENORMALS to ensure lighting occurs properly.

Share this post


Link to post
Share on other sites
Thanks Namethatnobodyelsetook~
Actually, I guessed so after thinking for few hours.
But I wasn't sure that because there is no way to look into
what's going on in GPU.
And your answer all clear to me.

[edited by - tsurudome on March 24, 2004 11:51:08 AM]

Share this post


Link to post
Share on other sites