Would be nice if there was a wireframe mode for objects.
Take a look at : X_GETFACE
Thats true - the only problem is that X_LINE could do with being sped up a bit. The larger object would be slower to display than a native command.
It is quite easy to use wireframe mode, if you use the OpenGL-Wrapper from Gernot
in the following example you'll have to add the files
3DPrimitives.gbas
gl.gbas
to your project and you can see the torus in wireframe mode
CreateTorus(0, 2, 5, 20, 4, 0, 0, RGB(255, 255,255))
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
WHILE TRUE
X_MAKE3D .1, 1000, 45
X_CAMERA 2, 2, -20, 0, 0, 0
X_AMBIENT_LT 0, RGB(255, 255, 255)
X_ROTATION phi, 1, 1, 0
X_DRAWOBJ 0, 0
INC phi, .2
SHOWSCREEN
WEND
you can switch back to filled mode easily with
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
Ah, thats handy!
by the way: as it seems that glPolygonMode is what X_CULLMODE is in GLBasic ...
what about a second optional paramter for X_CULLMODE? e.g. X_CULLMODE mode%, wire% = FALSE
Word to the wise, be aware that glPolygonMode is not available in OpenGLES, so anything off of a desktop probably does not support this code...
hi Ocean,
sure, it's also possible to use these functions within the loop.
CreateTorus(0, 2, 5, 20, 4, 0, 0, RGB(255, 255,255))
CreateSphere(1, 2, 10, RGB(255, 255, 255))
WHILE TRUE
X_MAKE3D .1, 1000, 45
X_CAMERA 2, 2, -20, 0, 0, 0
X_AMBIENT_LT 0, RGB(255, 255, 255)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
X_ROTATION phi, 1, 1, 0
X_DRAWOBJ 0, 0
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
X_MOVEMENT 0, 0, 2
X_ROTATION phi, 1, 0, 1
X_DRAWOBJ 1, 0
INC phi, .2
SHOWSCREEN
WEND
see also documentation here
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonmode.html (http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/polygonmode.html)