Jump to content
  • Advertisement


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


2D Objects in a 3D World

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!