#### Archived

This topic is now archived and is closed to further replies.

# 3D Camera Control

This topic is 6074 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m trying to write camera control code that will give me control like what is offered by most 3D modellers. Basically, I want a camera that moves around on the inside of a virtual sphere (the full shape, all 360 degrees on each axis), and will allow the origin of rotation to pan around. Right now I am using plain spherical coordinates (3D polar coordinates) and I''m having a little trouble doing the panning, because even when I do get it to translate over the correct plane (the view plane) the scene effectively rotates around the point at the center of the screen (the original origin so to speak). Does anyone know what I''m talking about? Does anyone know of any documents on the web (not necessarily code) that describe this kind of camera control? Thanks!

##### Share on other sites
Ken Shoemaker''s (is that right) Arcball algorithm is what you need. Just do a google search on arcball shoemake

##### Share on other sites
Everything I can find about the arcball or virtual trackballs is only for rotation. I guess I should have been more specific in the original post.

I'm fine on rotation, I'm using spherical coordinates, which allow you to specify a radius, an angle off the x axis and an angle off the y axis and use some trig functions to get (x,y,z) rectangular coordinates for the point on the sphere at those two angles. This works well, and makes the rotation and zooming really easy. I'm just having a problem with the panning.

Basically, I can get the view plane and move on it, but when I try to rotate after panning it appears to rotate around the screen center point (the transformed origin) rather than the actual origin.

I'd like to stay away from quaternions if at all possible.

I'll probably be able to work this out, but I don't have that much time for programming right now, so I just thought I'd ask and see if anybody has any info about it.

Thanks!

Edited by - Qoy on November 5, 2001 1:50:33 AM

1. 1
2. 2
3. 3
4. 4
Rutin
18
5. 5

• 11
• 21
• 12
• 11
• 11
• ### Forum Statistics

• Total Topics
631405
• Total Posts
2999885
×