Archived

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

mobias

2D Objects in a 3D World

Recommended Posts

mobias    122
Hi. I have a game made in DX8 and I want to draw a 2D Object as the panel at the bottom like in games such as red alert and starcraft. Can anyone help me with rendering 2D Objects in a 3D World? Regards, Luke

Share this post


Link to post
Share on other sites
Raloth    379
You can either use an orthogonal projection or use pre-transformed vertices. If all you want to do is add some kind of interface, pre-transformed vertices are probably easier. How to do them:

Instead of declaring x,y,z as your location variables, use x,y,z,rhw
Change the D3DFVF_XYZ flag to D3DFVF_XYZRHW

This will make it so every unit you give it will correspond to 1 pixel on the screen. Don''t worry about what rhw means, I don''t even know if anyone knows for sure since I''ve never seen a good explanation of it . Just make it 1.0 and everything should work fine.

Share this post


Link to post
Share on other sites