View Full Version : XYZ points in OpenGL
11-15-2008, 04:33 PM
A DXF file is being read in with real world X,Y,Z coordinates. Is there a good tutorial on how to go between these values and the OpenGL coordinates and planes?
Many thanks in advance.
11-15-2008, 06:26 PM
There is no such thing as 'OpenGL coordinates'. You decide what 1 OpenGL unit shall be in your application. It is up to you if 1 OpenGL unit is 1 mm, 1 km or 1 parsec.
Any reason why you cannot use the DXF coordinates directly?
11-16-2008, 03:09 AM
No, it's just that the documentation I have come across uses glut or another library to do the transformation mapping. A commented example or tutorial of how to apply the vertex extents to the viewport was what I was looking for further documentation on.
11-16-2008, 04:56 AM
I don't understand what you means with "transformation mapping" as Satan say there is not openGL units, the only convention is that the "UP" direction is on the Y axis and the left hand rules is used, so your coordinates are something like this.
Here you can find some better explanation about openGL coordinate convention (it don't speak about units :P )
11-17-2008, 06:03 AM
Transformation mapping is used in the context of transforming the XYZ coordinates so that they map into the display window.
glOrtho() is the function that sets the buffer up correctly. Setting the min & max for each direction to be larger than the largest XYZ allows the entities to be displayed. I was able to use the glRotate() OK, but am still having issues with the gluLookAt().
Thanks for the link as I had not run across it before.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.