Best way to draw a triangle

Best way to draw a triangle

Post by Paul Kirkbrid » Sat, 10 May 2003 05:31:22



I have noticed that on the DX9 SDK in the tutorial1 code
which draws a simple triangle to screen the code is very
different to what the DirectX9 AppWizard creates.  The
AppWizard when selected from the Visual C++ create a new
project section gives you the option to create a basic
triangle.

Now the SDK version of the code only creates one triangle
and cannot be rotated but the AppWizard version of the
code creates a triangle with both a front and back to it
can be rotated.  Is this the only reason the code differs
so much for the two applications?

If I haven't explained it too well, I'll have another go
if you have a problem understanding me.

Thanks,

Paul.

 
 
 

Best way to draw a triangle

Post by Rich [Microsoft Direct3D MV » Sat, 10 May 2003 08:07:53


[Please do not mail me a copy of your followup]



Quote:>Now the SDK version of the code only creates one triangle
>and cannot be rotated  [...]

Tutorial 1 uses XYZRHW vertices.  XYZRHW vertices are "transformed"
vertices and don't participate in vertex processing.  Vertex
processing is what allows the triangle to be rotated without editing
the vertices every time.

Quote:>but the AppWizard version of the
>code creates a triangle with both a front and back to it
>can be rotated.  Is this the only reason the code differs
>so much for the two applications?

The tutorial is extremely simplistic in terms of how it enumerates
devices and selects the "best" device.  The AppWizard code handles the
fully general case.  That is why the code is so different.
--
    "The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
              <http://www.xmission.com/~legalize/book/>

 
 
 

Best way to draw a triangle

Post by Jacky Lu » Sat, 10 May 2003 19:24:28


Believe it or not. I have been struggling with DX for a year and cannot
completely master it. So I still have to struggle on. So how long have you
been with it? And It'll take long :))



Quote:> I have noticed that on the DX9 SDK in the tutorial1 code
> which draws a simple triangle to screen the code is very
> different to what the DirectX9 AppWizard creates.  The
> AppWizard when selected from the Visual C++ create a new
> project section gives you the option to create a basic
> triangle.

> Now the SDK version of the code only creates one triangle
> and cannot be rotated but the AppWizard version of the
> code creates a triangle with both a front and back to it
> can be rotated.  Is this the only reason the code differs
> so much for the two applications?

> If I haven't explained it too well, I'll have another go
> if you have a problem understanding me.

> Thanks,

> Paul.

 
 
 

Best way to draw a triangle

Post by Paul Kirkbrid » Sat, 10 May 2003 20:53:30


Hi,

I have been learning DirectX for about 2 years now maybe
more.  I spent a year breaking down everything to do with
the MS DX framework and now understand fully how that
works.

I can pretty much do most things with DX, load a mesh
etc, however occasionally I hit something which lights up
my brain.  I end up forgetting stupid little things and
post dumb posts like this one LOL.  I'm messing with
shaders at the moment.

Thanks for the feedback.

Paul.

Quote:>-----Original Message-----
>Believe it or not. I have been struggling with DX for a
year and cannot
>completely master it. So I still have to struggle on. So
how long have you
>been with it? And It'll take long :))