Get a camera position with fsin fcos?

Posted By: NicolaB

Get a camera position with fsin fcos? - 05/20/20 12:26

Hi
I working on a flight sim and a "passing by camera". The idea is to place the (staedy!) camera about 3000 in front of the plane (or Player.pan) and a little to the right side. So if the plane is at postion 0,0,0 the camera.x should be at plane.x + 3000 (plane.pan! angle), and plane.y + 1000 (a little to the ight). the hight could be + 200.
The plane is also tilting, this should be bypassed, Panorama only please.

Any ideas??
Many thanks in Advance!
Posted By: 3run

Re: Get a camera position with fsin fcos? - 05/20/20 13:11

Hey!

I would use something like this:
Code
VECTOR temp_vec;
vec_set(&temp_vec, vector (3000, 1000, 200)); // offset
vec_rotate(&temp_vec, vector (plane->pan, 0, 0)); // panorama only
vec_add(&temp_vec, &plane->x);
Posted By: NicolaB

Re: Get a camera position with fsin fcos? - 05/20/20 13:16

Hi 3run! Thanks you!

I will try it … let you know how it works out...
Posted By: 3run

Re: Get a camera position with fsin fcos? - 05/20/20 13:24

Made some changes (missed "panorama only" part in your message), check them out.
Posted By: NicolaB

Re: Get a camera position with fsin fcos? - 05/20/20 13:53

Thank you 3Run! Now it works fine! But still I had to pass by the tilt, so it looks like this:

if(vec_dist(camera.x,player.x) > 3300){

vec_set(cpassby, vector (2900, 800, 200));// Keep below if-distance!!
vec_rotate(cpassby, vector(player.pan,0,0)); // Vector -> JUST PAN , NO TILT OR ROLL angles! <-
vec_add(cpassby, player.x);
}
Posted By: NicolaB

Re: Get a camera position with fsin fcos? - 05/20/20 13:54

Ah we just did the same XD
Posted By: 3run

Re: Get a camera position with fsin fcos? - 05/20/20 14:11

Hehe, I'm glad it worked out well :>
Posted By: NicolaB

Re: Get a camera position with fsin fcos? - 05/20/20 15:20

Hi 3Run, another Question you might can help me:

I would like to have a Reply function, that shows the last 5-10 seconds again.
I know there was an AUM tutorial that did that, but i don`t remember which one.
It worked like storing postions and states of several level entities Frame by Frame into a file, and as Reply started, just reading it out again.
Posted By: NicolaB

Re: Get a camera position with fsin fcos? - 05/20/20 15:50

Hello ! I found it: it`s in AUM 70
© 2024 lite-C Forums