In front of camera

Posted By: Logitek

In front of camera - 02/02/14 16:09

Hello.

Maybe you can help me.
I have a question about creating an object in front of camera.
But far away. Exactly in the center of the screen.

Would this code be okay and right?

temp.x = camera.x + (quants away for example 20000) * cos(camera.pan);

temp.y = camera.y * sin(camera.pan);

temp.z = camera.z

Would this be exactly the center of the screen? Or is something wrong with temp.y or temp.z. I am not sure.
Posted By: Uhrwerk

Re: In front of camera - 02/02/14 17:05

You're code does not respect that camera's tilt. Here is an easy way to do it:

Code:
vec_set(temp,vector(512,0,0));
vec_rotate(temp,camera.pan);
vec_add(temp,camera.x);
ent_create(SPHERE_MDL,temp,NULL);

Posted By: Logitek

Re: In front of camera - 02/02/14 17:41

Great! Thank you.
© 2024 lite-C Forums