Archived

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

notehaha

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

Recommended Posts

notehaha    122
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
notehaha    122
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
CrazedGenius    156
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
Arcus    122
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