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 / How to create a 3rd person chase view camera in a free flight game?

Author
Message
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 19th Oct 2003 17:35
Hi, I had a flight simulator game with 3rd person view. I can't use SET CAMERA TO FOLLOW as this only turns the camera in its Y-axis, and the camera always remains upright, which is not suitable for game with free flight, such as mine.

Any ideas? Thanks!

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

http://www.badnose.com/
Zen_Budha
22
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Water Valley, MS
Posted: 19th Oct 2003 18:52
Just a thought but IL2 Sturmovick Forgotten Battles which is a top not flight sim does the same thing. When you go to external view it only rotates on the Y axis.
Yet it also allows you to change camera angles by moving the mouse. Another idea as someone was saying about a FPS. You could attach a invisible limb behind the aircraft, and attach the camera position to it.

He who stands on toilet is high on pot!
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 20th Oct 2003 19:43
Spooky is the hero here. A while back he posted the attached code. REspect to him.

Remember what you see is not a mystery but... rrrRRRENTAGHOST!

I've actually got the theme music to that old programme on my 'puter. How sad am i? Or perhaps I should say: Gadzooks!

Philip

What do you mean, bears aren't supposed to wear hats and a tie?
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 20th Oct 2003 19:44
... though I'm willing to bet practically nobody remembers StarFleet on Saturday kid's TV - early 1980s.

What do you mean, bears aren't supposed to wear hats and a tie?
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 20th Oct 2003 19:46
Gadzooks indeed Mr Claypole!

If your mansion house needs haunting, just call Rentaghost!
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 20th Oct 2003 19:48
Seriously though, that code is ok but Bulleyes is probably after some better code that smooths the camera from one view to another. I have no need for that so didn't bother trying!

Might give you some ideas though.

If your mansion house needs haunting, just call Rentaghost!
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 20th Oct 2003 19:55
Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn't commit. The men promptly escaped from a maximum security stockade to the Los Angeles underground. Today ...

What do you mean, bears aren't supposed to wear hats and a tie?
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 20th Oct 2003 21:34
This may work for you

set camera to object orientation (obj)
position camera Object Position x (obj),object Position y (obj)+100, object position z (obj)
Move camera -100
sync

Basically the intent is to put camera is same place as object then move it up and back 100 units

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Oct 2003 21:38
... still wanted by the government they still survive as soldiers of fortune. So if you have a problem, if no-one else can help, and if you can find them, maybe you can hire ...

*And* I remember starfleet ... sort of ... big robot ship ... bad guys with a 'thing' over one eye ... and that's about it.

Hmmm, wonder if I can google it?
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 21st Oct 2003 10:38
@Spooky

Sorry, I might miss your posting regarding this. Do you mind repost here again? I don't need a complete code, I just need to know the idea how you done it. (Pseudocode maybe?) Thanks a bunch!

@Codger

Yes, I had thought of a way something like what you posted. But instead of positioning the camera at the same place at your object, I can use matrix math to calculate an arbitary position relative to the object. For example, if I wanna place the camera at position (0, 10, -50) relative to the object, I can roughly do something like this for positioning the camera:



After all this, I will just need to set the camera orientation like what you showed be, i.e.

set camera to object orientation (obj)

By combining your method and mine, I guess i can make my third person camera working. But one more challenge, how do I allow camera smoothing? I can interpolate the camera's position but I couldn't interpolate its orientation. If you think that I can just interpolate the camera angles according the object angle, then you are wrong. I tried that before but it doesn't work. In freeflight, the object angles changes in a "weird" way (not really weird if you know why), whenever you called those pitch, roll, and turn commands, i.e. an object Z angle at 170 might changed into -180 whenever you perform a slight roll.


Ideas anyone? Thanks!

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

http://www.badnose.com/
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 21st Oct 2003 13:56
Erm, look at Philip's post above and you will se he has posted my code in the 'source' box.

If your mansion house needs haunting, just call Rentaghost!
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 22nd Oct 2003 15:01
@Spooky - I aim to serve.

@IanM - impressive, most impressive. You know your A-Team. There are indeed many informative webpages on Starfleet btw.

Philip

What do you mean, bears aren't supposed to wear hats and a tie?
Zener
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: United States
Posted: 22nd Oct 2003 22:15
I am in the process of making a space flight game which uses a 3rd person camera. What I did was used limbs kinda like a mounting system.

The first limb was used to mount the object or ship, and the second limb was used as the camera mount. Then to move the camera I would move the limb it was attatched to so it would always be fixed with the pitch, yaw and roll of any other object using that limb setup.

Now you have to remember to use the limb root to do all of your movements to keep it all together.

I have a flight system somewhat like the game freelancer. So if that is what you are going for then this limb methode may work for you.
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 26th Oct 2003 18:10
@Zener

Meaning that you always place the camera at your camera mounting limb using LIMB POSITION, and rotate your camera based on the values return by LIMB DIRECTION?

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

http://www.badnose.com/
Zener
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: United States
Posted: 26th Oct 2003 20:15 Edited at: 26th Oct 2003 20:16
Here is my first test with the 3rd person camera. I was using the limb position for the x,y,z location and using the root object for rotation.
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Oct 2003 21:39
Mmmmm.. i thought that POINT CAMERA would already rotate it automatically and made ROTATE CAMERA redundant...
Zener
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: United States
Posted: 26th Oct 2003 22:33 Edited at: 26th Oct 2003 22:35
Hehe yeah it does, i just posted my first test and forgot to take all the junk out. sorry about that.

Oh and you want to keep the rotate and not the point to command as the point to object command won,t rotate all axis.
Zener
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: United States
Posted: 26th Oct 2003 22:40 Edited at: 27th Oct 2003 19:58
Here I updated it to exclude that stuff.



I updated this code snipit to simulate a leading camera.

ignore the source button below, i pasted the wrong code in it hehe.

Login to post a reply

Server time is: 2026-07-26 19:46:37
Your offset time is: 2026-07-26 19:46:37