Jump to content
  • Advertisement

Archived

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

notehaha

I want to create status bar (2d) in d3d

This topic is 6036 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, Now,I finished build 3d models and I also render them to my game. Then, I want to create status bar that representing model''s HealthPoint. You know?The HealthPoint Bar must show me in the same place,when I change camera point. I think it must be use 2d surface. I''ve read "GameDev_net - 2D Rendering in DirectX 8" Tutorial. But it be use in 2d graphic only ,or not??. So ,Could anyone tell me how to make 2d surface in finished 3d world? I want 2d surface showing,and 3d world behind 2d surface showing too.

Share this post


Link to post
Share on other sites
Advertisement
just only set Projection?

in render loop:
{
d3ddevice->settransform(D3DTS_PROJECTION,&Ortho2d);
Draw2d();

d3ddevice->settransform(D3DTS_PROJECTION,&Perspective);
Draw3d();
}

Only this?

Ok, I will try.
Thank you for your fast reply.

Share this post


Link to post
Share on other sites
You may want to (re)set your view and world matrices depending on what you are doing in the 3D space...

If you have everything working in 3D and you understand the article, just flipflop the matrix states between 2D "mode" and 3D "mode"

Share this post


Link to post
Share on other sites
Actually, yes - if you never need to bother changing the position of anything, use transformed. This is probably the case for a status bar. Good point.

Share this post


Link to post
Share on other sites
I use transformed vertices. Try looking at the 3dFont sample included with the SDK. They use tranformed and lit vertices for drawing 2d text on the screen using screen coordinates. This is, in my opinion, the easiest and most intuitive way of drawing 2d such as menus, status bars, or any kind of GUI. HTH.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!