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 / 3rd person rotating camera.

Author
Message
MattR
19
Years of Service
User Offline
Joined: 27th May 2005
Location: Staffordshire, UK
Posted: 27th May 2005 08:42
Hey guys, just wondering if anyone can offer me any advice with gettin a 3rd person camera up and running. Feel free to just point me in the right direction of other threads that have already talked about this. Yeah, anyway. Basically I need a camera that will sit a set distance, I'll call this "x" behind my player object, and rotate around the player as and when the player object is rotated by the player. I also need the camera to rotate up and down, but without the player object rotating with it. I've got a couple of sketches to try and help explain what I mean...

Ok, these are arial view.


and these ones are from a side view.


I started working things out using trigonometry, but the formulas have got pretty untidy and kind of complex... (at the moment it needs a different one for each 90 degrees) I'm hoping there's a simpler way *crosses fingers* I've been mainly working on paper so far, so I don't really have any code down as of yet, just trying to understand the concept of it first.

Thanks for your time (hope someone understands what I've babbled on about.)
-Matt
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 27th May 2005 20:03
Here try this... it's actually a DB example file that i have modified ever so slightly, so use the arrow keys to move and rotate the player object and the camera will follow and rotate as so, use the shift key to raise the camera and the ctrl key to lower it

i hope this is of some help to you

I can see from your smile, you're not here for the sunset.
MattR
19
Years of Service
User Offline
Joined: 27th May 2005
Location: Staffordshire, UK
Posted: 28th May 2005 02:21
That's the kind of thing I'm after, thank you. I pasted it and compiled and it does exactly what I asked for, time to have a look through the code and make sure I understand everything. I may post again if there's anything I'm unsure about. Cheers for that, it's much appreciated.
-Matt
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 28th May 2005 03:23 Edited at: 28th May 2005 03:25
try this, I found it in code base and edited it until i got what I needed:



I discriminate against discriminating people....
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 28th May 2005 04:27
Try my code in this thread..it's not specifically for cameras but it has camera control sub routines that do what your drawings show

http://forum.thegamecreators.com/?m=forum_view&t=54340&b=1

Login to post a reply

Server time is: 2024-09-23 21:29:28
Your offset time is: 2024-09-23 21:29:28