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 / Free Flight 3rd Person View

Author
Message
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 19th Jul 2003 14:15
Hi,

I made a space combat game which which played using 3rd Person View. As it is a spaceship, it can freely move and rotate in terms of pitch, yaw, and roll.

I tried to use "set camera to follow" command for the camera but it doesn't work. The camera won't follow the tail of my spaceship if I pitch up and down.

It seems like this command only work on those RPG style of game, where the character can only rotate left and right.

Any ideas? Thanks!
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 19th Jul 2003 19:47
You need to make the camera position and its angle of view change each time you move the ship so that its angle of view matches that of the local z axis of the model you are looking at.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 19th Jul 2003 21:06
I don't think it is as easy as that. This is because the 3rd person camera has certain distance behind the ship. Therefore, I believe besides setting the orientation, we need the calculation to get the position behind the ship, by using the negation of the vector where the ship is pointing now.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 19th Jul 2003 21:25
A rudimentary method that i used was to put a limb behind my ship (a small cube ) where the cam should sit , hide it and position the camera there:

position_camera:
cx#=limb position x(9999,1)
cz#=limb position z(9999,1)
cy#=limb position y(9999,1)
position camera cx#,cy#,cz#
xrotate camera wrapvalue(oax#+20)
yrotate camera oay#
zrotate camera oaz#
return

9999 is the ship, limb 1 is the hidden cube
oax#,oay# and oaz# are the ship angles, where oax# is increased by 20 in order to point the ship or the cam would look straight forward
i wasn't using pitch, yaw and roll tho.. not sure if you can adapt this hint to your case..
Muddleglum
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: New Zealand
Posted: 20th Jul 2003 04:03
a common method with free flight is to:-
set camera to object position
set camera orientation to object
move camera (minus your required viewing distance.)

if you have a level landscape which you want the camera to stay level with then add after that,

point camera x,yz of object you are following.

smoother 'delayed' following will take more maths- or delay routine -as well.

cheers.
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 20th Jul 2003 05:04
How bloody odd!! I wrote that exact same thing muddleglum (almost identically) but my post didnt appear. I had to read yours 3 times to realise it wasnt mine!

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
Muddleglum
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: New Zealand
Posted: 21st Jul 2003 01:04
egad ! perhaps this means this forum is the first case of spontaneous artificial computer intelligence ! ... which can detect near duplicate posts ...?
.. or the moderators ? very odd.
GameKit
23
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 21st Jul 2003 05:20
Hmmm... I did something like this once, so try...



or for a smoother effect...



Well... I hope that helps...

Anyone Can Destroy...But Few Can Create...

Login to post a reply

Server time is: 2026-07-21 20:53:30
Your offset time is: 2026-07-21 20:53:30