• 14
• 12
• 9
• 10
• 13

# how to align a quad to the screen

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

## Recommended Posts

how exactly do i align a quad to the screen? also, eventually i would like to create a gui. the only thing i'm really hung up on is the coordinate system of the screen. how would i go about making it so that the bottom left corner is (-1.0,-1.0) and the top right corner is (1.0,1.0) so that i could define a quad within that range and have it display in the correct place on the screen? i'm using opengl for this if it matters. thanks.

##### Share on other sites
Check the OpenGL FAQ to see how to use Ortho mode in OpenGL; this will allow you to position quads on the screen using pixel coordinates.

I'm not too sure what you would do mathematically to find coordinates of a quad that align with the screen in a parallel fashion to the view frustrum. However, I expect (and I'm no expert, believe me!) that you could simply add up all the rotations up to the point where you want to draw the parallel geometry, and then reverse them, like this pseudocode:

Rotate(XRotate, YRotate, ZRotate)DrawSomeStuff()Rotate(-XRotate, -YRotate, -ZRotate)DrawParallelObjects()

This may not work though, so I'd test it if I were you :)