Jump to content
  • Advertisement
Sign in to follow this  

diagrams with directx 9

This topic is 5200 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
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]


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.


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!