How do I draw lines using XNA?

后端 未结 10 1227
情书的邮戳
情书的邮戳 2020-12-05 04:19

I\'ve read a bunch of tutorials involving XNA (and it\'s various versions) and I still am a little confused on drawing primitives. Everything seems to be really convoluted.

10条回答
  •  春和景丽
    2020-12-05 04:27

    When working with XNA, everything (even 2d primitives) have to be expressed in a way that a 3d card can understand, which means that a line is just a set of vertices.

    MSDN has a pretty good walkthrough here:

    http://msdn.microsoft.com/en-us/library/bb196414.aspx#ID2EEF

    You'll find that it takes more code to render a primitive line than it would take to just setup a textured quad and rotate that, since in essence, your doing the same thing when rendering a line.

提交回复
热议问题