Jump to content
  • Advertisement

Archived

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

mobias

2D Objects in a 3D World

This topic is 5524 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
Advertisement
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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!