Re: Drawing 2d graphs using Direct3d
From: Rich [Microsoft Direct3D MVP] (legalize+jeeves_at_mail.xmission.com)
Date: 04/01/04
- Next message: sfriend: "Re: Drawing 2d graphs using Direct3d"
- Previous message: sfriend: "Drawing 2d graphs using Direct3d"
- In reply to: sfriend: "Drawing 2d graphs using Direct3d"
- Next in thread: sfriend: "Re: Drawing 2d graphs using Direct3d"
- Reply: sfriend: "Re: Drawing 2d graphs using Direct3d"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 01 Apr 2004 09:14:57 -0800
[Please do not mail me a copy of your followup]
"=?Utf-8?B?c2ZyaWVuZA==?=" <anonymous@discussions.microsoft.com> spake the secret code
<D30C3B69-01DB-4E1B-96D1-E4C83115D1CD@microsoft.com> thusly:
>I don't know Direct3d, just order Tom Millers book. Can anyone give me
>any suggestions on how I would go about doing this in Direct3d , should
>I be using Vertex's to draw the waveforms or is there a better method ?
I would use a circular buffer of vertices to draw this:
+--------------------+
+===============|====================|===============+
H | | H
+===============|====================|===============+
+--------------------+
The inner rectangle is what's currently being shown on the "strip
chart" and the wider rectangle is what's being held in the vertex
buffer. You write new vertices on the end of the buffer and adjust
the strip chart to display the old stuff plus the newly added
vertices. This way you're not resending the entire strip chart to the
card every time you update. When you get to the end of the buffer,
you have two choices, either resend all the visible data to the
beginning of the buffer or break the draw up into two chunks: one at
the end of the buffer and one at the beginning of the buffer.
>Is there a fast way to perform a scroll, or do I just redraw the lines
>each time ?
In 3D you redraw the whole scene every time. That doesn't mean you
can't cache rendered chunks of the scene for quick redraw (think
memory DC in GDI terms), but generally you just redraw the whole scene
and don't think of caching schemes until things get slow.
--
"The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
<http://www.xmission.com/~legalize/book/>
Pilgrimage: Utah's annual demoparty
<http://pilgrimage.scene.org>
- Next message: sfriend: "Re: Drawing 2d graphs using Direct3d"
- Previous message: sfriend: "Drawing 2d graphs using Direct3d"
- In reply to: sfriend: "Drawing 2d graphs using Direct3d"
- Next in thread: sfriend: "Re: Drawing 2d graphs using Direct3d"
- Reply: sfriend: "Re: Drawing 2d graphs using Direct3d"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|