rotating an object around a abitrary point

Hi i’ve got a question, I have defined my camera class, with right, up, forward vectors, so i can move freely across the world,
and basically have a FPS camera(6DOF),
but since i’m trying to incorperate also a level editor into my world i want that this world can rotate by mouse move. So instead of looking, up and down when moving my mouse, i want the world to rotate around a point. So to visualize the process, it’s basically rotating the camera around a sphere, with it’s viewing direction always focussed on the center of this sphere.

I’ve the arc-ball tutorial on nehe’s site, but i’m getting strange results, maybe because my camera isn’t in the center anymore coz of the fps camera.

tia

Paul

Are you transforming and then rotating or rotating and then transforming. You’ll find that the order in which you need to do things should be in the reverse of what you expect.
For example if you are rotating an arrow arround a circle, so it acts like a compass point, then you need to rotate and then transform. I had read about this but it didn’t hit me until I actually was doing this on my own (I had forgotten about that fact).

I dont think moving/rotating the camera is a good way.

I will recomend you to rotate/move all your world by adding one more world placement stage on your editor (basically rotation+translation), reverting this last stage will give you your real world position when for example you want to add an object.

When you save your project or world model, remove this finale stage and your world will be well exported.

Something like that:
WorldObjects=>>EditorRotation(rx,ry,rz)=>>EditorTranslation(tx,ty,tz)=>>ReadyToRenderWorldObjects

Getting WorldPos
MousePosInWorld=<<EditorRotation(-rz,-ry,-rx)<<=EditorTranslation(-tx,-ty,-tz)<<=MousePosInScreenWorld

And for example:
Moving mouse with left button modify parameter rx,ry,rz
Moving mouse with rightbutton modify parameter tx,ty,tz

When you save, you just save WorldObjects wich is not affected by EditorRotation/EditorTranslation

Bruno