Initially I have been looking at the Tutorial code that comes with the
DirectX 9 SDK. In Tutorial #2 it illustrates what seems like a rather
simple process of defining three vertices to paint a triangle. So, to
extend this to a rectangle, then pentagon, the hexagon, etc., I figured I
could just add a forth vertex array element. This did not work. Am I
missing something simple, or is this tutorial not a good starting point for
drawing 2D shapes with DirectX 9?
Any help, redirection to source material, etc. would be greatly appreciated.
Ken
> Initially I have been looking at the Tutorial code that comes with the
> DirectX 9 SDK. In Tutorial #2 it illustrates what seems like a rather
> simple process of defining three vertices to paint a triangle. So, to
> extend this to a rectangle, then pentagon, the hexagon, etc., I figured I
> could just add a forth vertex array element. This did not work. Am I
Look up the difference between "Triangle Lists", "Triangle Fans" and
"Triangle Strips" in online help.
One of them does what you expected, but sample 2 uses another.
> missing something simple, or is this tutorial not a good starting point for
> drawing 2D shapes with DirectX 9?
The tutorials are a perfect place to start.
will create a pentagon with a length of 1.. switch 5 to 8, and you have an
octagon..
If you just want the outline of the polygon, you could also do this 'by
hand' like you mention below by using the primitive type LineStrip
instead...
--
- Tom Miller, Dev Lead, Managed DirectX
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kenneth Everett" <Kenneth...@comcast.net> wrote in message
news:#6qWGleF...@tk2msftngp13.phx.gbl...