Jump to content
  • Advertisement
Sign in to follow this  
Matthew Shockley

DirectX Drawing Rectangles

This topic is 3028 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!