Sign in to follow this  

Help, my arcball always rotates around the origin! -Problem kicking me in my arcballs

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I spent some hours today implementing arcball rotation for a level editor I'm coding. It's working fine, as long as I don't do any panning or zooming of the camera. When I do that, the rotation still takes place around the origin, not the kind of behaviour you would expect from a level editor. Any idea how I can rotate around where I'm looking at (view vector), instead of the origin? PS: my implementation is based on the arcball code from NeHe lesson 48 Thanx in advance, Jeroen

Share this post


Link to post
Share on other sites
Hello,

this would be very simple to do if I actually rotated the camera around the world, but instead I have until now avoided this by rotating the world. I guess everything would be simpler if I rotated the camera instead of the world. The problem is I don't know how to do that. I tried a couple of things like multiplying my rotation matrix with the position vector of the camera, but it doesn't work like expected. So the new question is: how can I apply the rotation matrix I get from my arcball functions to modify the camera position instead of the world?

Any help would be greatly appreciated,
Jeroen

Share this post


Link to post
Share on other sites
Ok, it's been a few days now and can't seem to figure out a solution. Can anyone tell me how to apply the rotation matrix I get from my arcball class to my camera? I tried taking the inverse of the rotation matrix and multiply that with my camera's position, and sometimes it almost seems to work but it's very twitchy.

PS: Eventually I want to use this to solve my problem above. I can't find any samples that do translation with an arcball camera. All the samples I've seen rotate around the origin, which already works perfectly. If you know of any samples or know how to do it yourself, please let me know.

Thank you for your time!
Jeroen

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this