Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Spherical Camera Movement

Author
Message
JimmyH
15
Years of Service
User Offline
Joined: 25th Feb 2011
Location:
Posted: 25th Feb 2011 20:08
Hey guys, I'm sure this has been addressed before but I've poured over the forums and can't seem to find a solution. I'm trying to make the camera move around a specific point based on a radius for zoom (typical spherical cam movement) and have found a few things based on vectors (which I'd rather avoid) and some posts about the three spherical movement equations but nothing about solid implementation. I've played with it and arrived at this:



which gives an acceptable movement left and right but moving the camera up and down just gives swirling and jumping. I'm sure there's probably some constraints on the angles I'm overlooking or something.
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Feb 2011 16:36
One possible working solution

Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 26th Feb 2011 18:43
I made this code a while ago. It even has some smoothing in it. You'll have to build your own zoom into it though, shouldn't be difficult.


JimmyH
15
Years of Service
User Offline
Joined: 25th Feb 2011
Location:
Posted: 26th Feb 2011 20:23
Thanks guys, works a treat
kaedroho
18
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 27th Feb 2011 01:31
A simple way on doing it would be



Your signature has been erased by a mod please reduce it to no larger than 600 x 120.

Login to post a reply

Server time is: 2026-07-16 04:35:56
Your offset time is: 2026-07-16 04:35:56