Jump to content

  • Log In with Google      Sign In   
  • Create Account

Draw HUD


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 SamiHuutoniemi   Members   -  Reputation: 259

Like
0Likes
Like

Posted 14 December 2012 - 08:08 AM

Hello!

I'm drawing my FPS as a sprite, and I want to have it drawn to the screen independetly of the camera position. For example, always in the lower left corner. I'm using an orthographic projection and I always have the z value of the sprite greater than the camera, and it always seems to draw it the same distance away from the camera. So far, so good. But if I move the camera in the x or y directions, the sprite moves in those directions too.

Do I need a separate viewport? Any other ideas?

Sponsor:

#2 GuyWithBeard   Members   -  Reputation: 823

Like
1Likes
Like

Posted 14 December 2012 - 11:51 AM

You want to have it shown as a normal 2D overlay? In that case you don't need to touch the camera projection at all. You can just draw it directly in NDC space. If you want to have it in 3D, but follow the camera you can just draw it in view space. That way it will always be "attached" to the camera, regardless of where it is. Other nearby objects might be drawn on top of it tough. In that case you need to draw it last, without depth, ie. using painter's algorithm.

#3 GeniusPooh   Members   -  Reputation: 157

Like
0Likes
Like

Posted 18 December 2012 - 01:02 AM

Hmm

I don't understand why you use new view matrix for 2D object .

You can use new view matrix for 2D object if you use identity view matrix :)

all will be solved :)

hohoho happy days

Beauty is only skin deep , ugly goes to bones

 

World's only 3D engine tunner and 3D engine guru.

 

and real genius inventor :) but very kind warm heart .. and having serious depression for suffering in Korea

 

www.polygonart.co.kr ( currently out dated and only Korean will change to English and new stuff when I get better condition :) sorry for that)





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS