Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, howardR), 1,001 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
In front of camera #436794
02/02/14 16:09
02/02/14 16:09
Joined: Nov 2009
Posts: 201
Logitek Offline OP
Member
Logitek  Offline OP
Member

Joined: Nov 2009
Posts: 201
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.

Re: In front of camera [Re: Logitek] #436797
02/02/14 17:05
02/02/14 17:05
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
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);



Always learn from history, to be sure you make the same mistakes again...
Re: In front of camera [Re: Uhrwerk] #436802
02/02/14 17:41
02/02/14 17:41
Joined: Nov 2009
Posts: 201
Logitek Offline OP
Member
Logitek  Offline OP
Member

Joined: Nov 2009
Posts: 201
Great! Thank you.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1