Using Opengl to draw 2 rectangles

Jul 23, 2014 at 4:13pm
I am a complete beginner and I was wondering how easy it would be to draw 2 simple rectangles in opengl and having them move up, down, left and right?

Jul 23, 2014 at 5:17pm
It is pretty simple to do, but it takes a decent amount of work though. Not really sure how to explain how difficult it is, though.

If you are thinking about learning it, here are some good tutorials:
http://www.opengl-tutorial.org
http://www.arcsynthesis.org/gltut/

Edit:
You will need to know some kind of advanced math to do it. Well, at least advanced to me. Matrices, Vectors, etc..
Last edited on Jul 23, 2014 at 5:19pm
Jul 23, 2014 at 6:06pm
OpenGL provides methods for drawing rectangles:
http://www.opengl.org/sdk/docs/man2/xhtml/glRect.xml

Moving them is just a matter of taking input from the user, and adjusting the position of the rectangles.

It's a pretty simple task, though there will be a lot of boilerplate you'll need to write first.
Jul 23, 2014 at 6:42pm
^ Much better explanation.
Jul 23, 2014 at 7:24pm
Wow, thank you so much this is better than I expected! Thank both of you for your help :)
Topic archived. No new replies allowed.