Jump to content
  • Advertisement
Sign in to follow this  
TomTomson

diagrams with directx 9

This topic is 4830 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 everybody, i am writing some kind of 3D car simulation. now i want to show some statistics on the screen for example diagrams for velocity, acceleration, steer angle… any idea how to make in directX 9.0 maybe particles and point sprites , or is it better to open a new window and use windows-stuff for this kind of visualization ? thanks for your help tom

Share this post


Link to post
Share on other sites
Advertisement
Grr, was almost done writing up a reply to this and FireFox crashed on me. Gotta love it when that happens [headshake]

You can definitely use various parts of Direct3D to draw diagrams on top of your 3D scene - there's no need (and for performance reasons you wouldn't want to) drop back to Win32/GDI calls.

The trick is to render all of your 3D geometry and then switch to a 2D format and draw your diagrams over the top.

I use a fairly standard "Transformed and Lit" vertex structure like this:

struct TLVertex
{
D3DXVECTOR4 p; // Store as [x,y,0,1]
DWORD c;
D3DXVECTOR2 t;
};

#define FVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 )


If your diagrams are constantly changing and fairly simple, you might get better performance by drawing from a user pointer (IDirect3DDevice::DrawIndexedPrimitiveUP()), alternatively a dynamic vertex/index buffer will do the job.

Rendering with a combination of points/lines/quads usually covers anything I want to do.

Alternatively, you might want to look into ID3DXLine, ID3DXSprite and definitely ID3DXFont for some stock implementations of common functionality.

hth
Jack

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!