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.

Newcomers DBPro Corner / [DBP] - rotate camera around an object

Ghost Games
Years of Service
User Offline
Joined: 1st Aug 2007
Posted: 16th Sep 2013 16:32

is there any way to make a camera to rotate in a cirkel around an object?? i can only get the camera to stand still an rotate i need it move in a cirkel instead.

AGK Backer
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 16th Sep 2013 19:05
Ghost Games - This is the wrong board, go over to the DBP Newcomers board...

It is very simple but depends on what you wish to achieve exactly...

Valued Member
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Sep 2013 19:12 Edited at: 16th Sep 2013 19:14
@Ghost Games
wrong section had better post it in newcomer Dbpro corners.
I'm not completly sure what your need , could be something like this ??

Edited. I jumped the gun again answering without being sure some one did....Sorry Mr Valentine.

I'm not a grumpy grandpa
Van B
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Sep 2013 11:10
Maybe something like this:

Function Orbit_Cam(obj,ang#,range#)
position camera object position x(obj),object position y(obj),object position z(obj)
rotate camera 0,ang#,0
move camera -range#

I will move this thread to the newcommer section tonight, may as well give it a little while, so the originator has time to see it.

I am the one who knocks...
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 20th Sep 2013 09:18
Quote: "cirkel"

As for the question:

pretty much use Van B's function (paste it in the bottom of your code) then call it from a loop like this:

inc angle

this would cause the camera to spin around an object quickly.
DBPro Master
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Sep 2013 17:56
If you don't need to orbit around the object in all 3 dimensions and the rotation stays on a non-rotated plane along the y-axis, then you can use this function so that the camera continues to point at your object as it moves.

If your orbit does indeed tilt off the axis', then it can still be done but requires a more complex rotation algorithm.

DBPro Master
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 21st Sep 2013 07:17 Edited at: 21st Sep 2013 07:28
This will get you orbiting in all 3 dimensions, and is controllable by the mouse. This could be changed to an automatic orbit pretty easily by passing in new tilt and pan values as parameters to the function and removing the mouse block.

Login to post a reply

Server time is: 2024-03-02 17:48:13
Your offset time is: 2024-03-02 17:48:13