PDA

View Full Version : problems with rotation



mithun_daa
11-12-2003, 08:14 AM
im tryin to rotate the object in the scene. when the object is initially rendered it is perfect, but when i try rotatin it, it turns into a line. i dont know whatz happenin. can neone help?
thank u

jebus
11-12-2003, 09:14 AM
post your code. no one can even attempt to guess the problem w/o the code.

mithun_daa
11-12-2003, 10:08 AM
Originally posted by jebus:
post your code. no one can even attempt to guess the problem w/o the code.
im sorry, herez the code

" display routine "

wglMakeCurrent mlngPic1hDC,mlngWindowcontext
glEnable (GL_DEPTH_TEST)
glClearColor 0, 0, 0, 1
glClear clrColorBufferBit
glClear clrDepthBufferBit
glMatrixMode GL_MODELVIEW
glLoadIdentity
gluLookAt 0, 0, dblzcam, 0, 0, -(dblZMax - dblZMin) / 2, 0, 1, 0
glRotatef intRotate, 0, 1, 0
glTranslated -dblActualXMin + dblXMin, -dblActualYMin + dblYMin, dblZMin + (dblZMax - dblZMin) / 2
glPushMatrix
glEnable glcLighting
glEnable glcLight0
glEnable glcColorMaterial
glColorMaterial faceFrontAndBack, cmmAmbientAndDiffuse
glLineWidth 10
glColor3f 1, 0, 0
glBegin bmLines
glVertex3d dblActualXMin, dblActualYMin, -dblZMin - 10
glVertex3f dblActualXMin, dblActualYMax, -dblZMin - 10
glEnd
glColor3f 0, 1, 0
glBegin bmLines
glVertex3f dblActualXMin, dblActualYMin, -dblZMax - 10
glVertex3f dblActualXMin, dblActualYMin, -dblZMin - 10
glEnd
glPopMatrix
glDisable (GL_DEPTH_TEST)
glFinish
SwapBuffers mlngPic1hDC
blnBusy = False
wglMakeCurrent mlngPic1hDC, 0

"viewvolume routine"

intRotate = 0
glMatrixMode GL_PROJECTION
glLoadIdentity
dblzcam = 0
glFrustum dblXMin, dblXMax, dblYMin, dblYMax, 1, temp
glMatrixMode GL_MODELVIEW
glLoadIdentity
glShadeModel smSmooth
glEnable glcDepthTest
glEnable (glcBlend)

i dont think u have to worry bout the values of dblxmin..... what im doin is im settin a viewvolume n im drawin the axes in the viewvolume, n im tryin to rotate it.

thank u