03-17-2006, 02:44 AM
i am indeed to develop a application which is used to import some CAD files. i need to display grids in the opengl viewport. please send me some example codes.
03-17-2006, 09:07 AM
I had really bad experience importing CAD data into OpenGL. CAD data consist of natively lines and arcs, but OpenGL is interested in polygon to render faces. Holes and overlapped surfaces are everywhere after conversion. I spent most of time to fix this problems manually during the project.
Anyway, drawing grid line is very simple in OpenGL, for example:
glVertex3f(0,0,0); // a pair of vertice (2 end points of line)
glEnd();It will draw a line between (0,0,0) and (1,1,0). Since the grid is static, it is a good idea to put it into a display list.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.