Sign in to follow this  

3D objects in 2D HUD??

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

So, I developed a HUD system for my school game which works on screen percentages. For example an object of dimensions {.5,.5} would have width and height of half the screen dimensions. Also, an object positioned at {.25,.25} would lie a quarter from the top and a quarter from the left side of the the screen. Given this input scheme, I'm looking for a good way to get 3D objects onto the screen. They show up, but they have no perspective. How can I impose some sort of perspective projection given coordinates from ranging from 0 to 1 ?

Share this post


Link to post
Share on other sites
To be able to have a 3d object, you have to have three dimensions - right now you only have two, the x and y screen space. If you are actually rendering 3d objects for your gui, then just altering the perspective transform is what you would do.

Otherwise, if you are just rendering 2d objects like boxes (which I suspect you are) then maybe you could apply a texture to them that makes the objects appear to have depth? How fancy are thinking of getting - you could use shaders to really make the objects do whatever you want.

Share this post


Link to post
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this