Hi, I’m making a ferris wheel in openGL and i need to be able to select one a viewpoint from within each of the 8 carriages that it has.

I currently have the wheel and carriages drawn, and other viewpoints made, but i dont know how to use glRotate to make my camera rotate around a point, and have it continue to look horizontal, ie. i dont want the camera to look at the centre of rotation.

Yeah, i could use glLookAt, but how would i keep track of the coordinates for my camera, and the coordinates to look at if im orbiting around a point?

Is there an algorithm to work out the dynamic translations needed to simulate a rotation and therefore let me update the coordinates of a point on the wheel dynamically as it rotates?

I’ve managed to get it so that my camera is orbiting and staying level, but it is orbiting around the world origin (at ground level) not around the cenre of the wheel (0.0, 30.0, 0.0)

the wheel is of radius 20 and here is the code im using at the moment