Click here to Skip to main content
15,884,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,

The following code with TAO framework for OpenGL with VB.NET works well and draws a triangle:

VB
Gl.glLoadIdentity()
Gl.glTranslatef(0, 0, 0)
Gl.glBegin(Gl.GL_TRIANGLES)
Gl.glVertex3f(0.2, 0.2, 1)
Gl.glVertex3f(0.7, 0.7, 1)
Gl.glVertex3f(0.8, 0, 1)
Gl.glEnd()


But when changing the z component of the gltranslatef function even by 0.1, nothing is drawn!
The following code draws nothing:

VB
Gl.glLoadIdentity()
Gl.glTranslatef(0, 0, 0.1)
Gl.glBegin(Gl.GL_TRIANGLES)
Gl.glVertex3f(0.2, 0.2, 1)
Gl.glVertex3f(0.7, 0.7, 1)
Gl.glVertex3f(0.8, 0, 1)
Gl.glEnd()


I want to change the z component of the gltranslatef in order to move forward or backward.

gltranslatef works good with x and y axes; the problem is only with the z-axis.

Thanks to any help.
Posted
Updated 7-Apr-13 5:51am
v2
Comments
Kenneth Haugland 7-Apr-13 12:08pm    
Not really familiuar with OpenGL, but dont they also require a DiffuseMAterial on both sides? If one side of the triangle isnt defined, it would be invisible? Perhaps thats what happened to your model?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900