[PyOpenGL-Users] glTranslatef between two glVertex3f
Brought to you by:
mcfletch
|
From: Astan C. <ast...@al...> - 2009-07-03 02:52:03
|
Hi,
I'm trying to draw a line between two points (x0,y0,z0 and x1,y1,z1)
like this:
glPushMatrix()
glEnable(GL_BLEND)
glTranslatef(x,y,z)
glRotatef(-angle[0],0,1,0)
glRotatef(angle[1],1,0,0)
glColor4f( 1, 0.0, 0.0, .8 )
glBegin(GL_LINES)
glVertex3f(x0,y0,z0)
glTranslatef(-x,-y,-z)
glRotatef(angle[0],0,1,0)
glRotatef(-angle[1],1,0,0)
glVertex3f(x1,y1,z1)
glEnd()
glDisable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glPopMatrix()
Where x0,y0,z0 is the point near or in front of the "camera" and the
point x1,y1,z1 is the point in "real world coordinates".
This doesn't seem to work. How should I be doing this assuming I don't
know how to calculate either point in terms of the other?
Thanks
Astan
|