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 Discussion / camera help

Author
Message
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 20th Apr 2005 08:09
i am making a flight sim game, and the camera will track the plane, but when it turns the camera doesnt stay behind the plane. if i just set the camera to the object angle, it gets all messed up and looks away form the plane when you turn. is there an equation that will get it to stay behind the plane and still look at it??? please help.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Apr 2005 03:40
Here's a little code to let the camera follow your plane:

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Apr 2005 03:41
mmmm, i just found a bug... the camera height isn't perfect...
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 21st Apr 2005 03:54
the height of the camera itself or the height of wich it points at?
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Apr 2005 04:04
the height of the camera... but the problem is:
when you pitch down/up and turn left/right when pitched, the plane rotates around it's z-axis. So the camera get's wrong values
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 21st Apr 2005 04:31
so that means the controles need to be rewrited. I can do it, but I'm to lazy and tired to do it :p
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Apr 2005 04:38
Yup, me too
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 21st Apr 2005 05:41
point camera object position x(1),object position y(1),object position z(1)

if you do that then it wont look away from your plane

"Well, if he dies, it'll teach him not to do it again." - Me
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 22nd Apr 2005 08:54
thanks. i figured it out before i got a response, but thanks anyway. it works ok now, but i want it to be smooth. its all chunkey. now i know i sound like a total n00b, (thats cause i am) but i dont know jack about smoothing. all i have to go on is the manual and it says nothing about it. so couild someone please explain how it works???
ChozoMufin
20
Years of Service
User Offline
Joined: 19th Apr 2005
Location: Columbus, OH
Posted: 26th Apr 2005 11:21
wait a minute, yes it does. dang, im dumb! anywhoo, i figured the smoothing thing out.

Login to post a reply

Server time is: 2025-05-23 11:01:05
Your offset time is: 2025-05-23 11:01:05