View Full Version : conversion...
03-24-2002, 11:45 AM
any easy way to convert coordinates from [0 - 512]x[0 - 384] to those [-1 to 1]x[ -1 to 1] crap? cause my program generates the first ones and i need a way to convert before drawing stuff..
im new to using opengl so i am not sure.... also.. it is -1 to 1 right?
03-24-2002, 11:57 AM
That's what the transformation matrices are for.
One way to do it would be
Put that in your initialization code and tell me what you think http://www.opengl.org/discussion_boards/ubb/smile.gif
You can then directly specify your coordinates with glVertex*, without doing any further conversions. 0/0 is the top left, 512/384 the bottom right, just like the old days. 0 is nearest, 10 is maximum depth, so you can also use z buffering if you want to.
03-24-2002, 05:05 PM
Ummm, how about [coordinate_x/512.0 - 1.0][coordinate_y/312.0 - 1.0]
I might have misunderstood what you want thought...
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.