#### Archived

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

# Converting 3D Coordinates to Screen Coordinates

This topic is 5563 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

how can i convert 3d coordinates to screen coordinates???

##### Share on other sites
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.

##### Share on other sites
i.e i have a tile with local coords (0.1234, 1.4321, 5.1234) and built up with following vertexes (untransformed and unlit)

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]

##### Share on other sites
hi - the D3DXVec3Project function will convert 3d coordinates to screen space coords.

hope this helps-

BM

1. 1
Rutin
29
2. 2
3. 3
4. 4
5. 5

• 13
• 13
• 11
• 10
• 13
• ### Forum Statistics

• Total Topics
632959
• Total Posts
3009468
• ### Who's Online (See full list)

There are no registered users currently online

×