Converting 3D Coordinates to Screen Coordinates
What do you mean by 3D coords?
Untransformed vertex (local coordinates) needs to go through world transformation, view transformation and projection matrices. I don''t have the sdk handy right now but I bet it''s there explained with a lot more details.
Untransformed vertex (local coordinates) needs to go through world transformation, view transformation and projection matrices. I don''t have the sdk handy right now but I bet it''s there explained with a lot more details.
i.e i have a tile with local coords (0.1234, 1.4321, 5.1234) and built up with following vertexes (untransformed and unlit)
so how can i calculate which pixels are used by this square?
[edited by - yaskil on July 28, 2003 8:32:31 AM]
p1 = D3DXVECTOR3(0,0,0);p2 = D3DXVECTOR3(3,0,0);p3 = D3DXVECTOR3(0,0,3);p4 = D3DXVECTOR3(3,0,3);so the tile will be screen | | | ------------------------------------------------------------||| p1 p2| .----------.| triangle1<-- | / || | / || | / | --> triangle 2| .----------.| p3 p4|||| ------------------------------------------------------------
so how can i calculate which pixels are used by this square?
[edited by - yaskil on July 28, 2003 8:32:31 AM]
hi - the D3DXVec3Project function will convert 3d coordinates to screen space coords.
hope this helps-
BM
hope this helps-
BM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement