Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGL + Lib3ds

Started by mwkenna Oct 13, 2006 at 3:24 PM 1 replies 850+ views
Original Post
mwkenna
mwkenna
Im having some trouble with camera view rotation in openGL using lib3ds. The rotation is going around the x-y axis and I am using the following function: void rotateCamera(float ang) { Lib3dsVector view; //get the view vector by subtracting the cam position from the target lib3ds_vector_sub(view, cam->target, cam->position); double lx = 0; double ly = 0; lx = ((view[0] * cos(ang)) + (sin(ang) * view[1])); ly = ((view[1] * cos(ang)) - (sin(ang) * view[0])); glLoadIdentity(); cam->target[0] = lx; cam->target[1] = ly; glutPostRedisplay(); showInfo(); } the Lib3dsVector structure is just a float[3]... The problem im having is when the camera view is rotating, rotation seems to speed up at some points and slow down at others. Also when the camera positions Z (up/down) value is set to something other than 0, the camera view seems to move up and down and all around? Any idea's anyone?
Lord_Vader
Lord_Vader
I dont know anything about Lib3d,
but to your first of your problems:
maybe the rotation slows down because the frame rate is dropping for a reason,lets say when there is a visible model, then if the model goes out of the screen after some rotation the frame rate is increasing, therefore the variation.

For the second, can you be a litle more specific?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.