DirectX Drawing Rectangles

Started by
11 comments, last by Zahlman 14 years ago
Can someone give me some example source code on how to draw a rectangle with DirectX 10?
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
Advertisement
Does anyone know how to draw an object with 4 points? Anyone?
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
Graphics cards really can only draw triangles. A rectangle is 2 triangles:

A      B*------*|\     || \    ||  \   ||   \  ||    \ ||     \|*------*C      D


So to draw the rectangle you draw 2 triangles: ABC and ADC

-me
draw two triangles
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.
Why is that? It seems to me that rectangles would be easier to draw than triangles, but ok.... lol.
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
Quote:Original post by Matthew Shockley
Why is that? It seems to me that rectangles would be easier to draw than triangles, but ok.... lol.


You can make just about everything out of triangles except for smooth curves, but how do you make a triangle out of a rectangle? You can't. But you can make rectangles out of triangles. The hardware is designed to do one thing and do it fast, that thing is triangles.

-me
Oh, I understand. Can anyone give me some source code on drawing triangles? I am very new to DirectX.
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
clicky [smile]

-me
I did the tutorials but you have to pay for them on DirectXTutorials.com when they get complicated.
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
what? they're all free. Or many of the other sites are. You can't draw a triangle yet, those ones are definitely free.

If you're copy-pasting the code, you're doing it wrong and not learning anything.

-me

This topic is closed to new replies.

Advertisement