Jump to content
  • Advertisement
Sign in to follow this  
bartiss

2D in 3D... What's the best solution?

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

I'm new in 3D, but so far I learned tha basics. But the question is how to display 2D user interface? I would like to display a GUI bitmap over a 3D scene. I learned a lot about DirectDraw and made lots of programs using it, but I just can't find a method to display a bitmap without all the vertices, transformations, etc. Maybe there's a way to initialize DirectDraw with Direct3D? Or maybe there is a way in pure 3D, but I just can't see it? Please help! I don't want to use 3D buttons aligned to a viewpoint! ;) Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Just render your GUI as geometry, but use an orthogonal projection (ie, not the perspective projection you use to display most of your scene)

Share this post


Link to post
Share on other sites
Use transformed vertices (vertices which are already in screen space). I think there's some tutorials on this.

Share this post


Link to post
Share on other sites
Using transformed vertices is not a good idea.
D3D will not supply cliping on the transformed vertices, so you have to clip by yourself.
It is recommanded to use Orthogonal projection.

Share this post


Link to post
Share on other sites
Quote:
Original post by Luffy
Using transformed vertices is not a good idea.
D3D will not supply cliping on the transformed vertices, so you have to clip by yourself.
It is recommanded to use Orthogonal projection.


UI elements, when designed properly, should not have the need to clip geometry, as they should be inside the viewport rectangle anyway. You're right, though - if one does need the clipping, it is advisable to use other methods (unless you have the clip data "for free" from the engine).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!