Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (alibaba, vicknick), 1,379 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Moving an entity in his local direction using a global vector #299056
11/20/09 18:41
11/20/09 18:41
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Hi, i want to move an entity towards the direction wich the entity is looking using global vectors. i've tested with this vector:

Code:
vector(cos(nave.pan)*key_m, sin(nave.pan)*key_m, sin(nave.tilt)*key_m)



But in this code each axis depends only of one angle, but it must depend of two, for ex. axis X depends of the pan an tilt of the entity, axis Y depends also of pan and tilt, anz axis Z depends of tilt and roll.
How I can do this?


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: Moving an entity in his local direction using a global vector [Re: painkiller] #299061
11/20/09 20:46
11/20/09 20:46
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
Try this smile
Code:
VECTOR dist;
 vec_set (dist,vector(100,0,0)); 
 vec_rotate(dist,my.pan);
 vec_add (my.x,dist); // move entity on x axis in local coord




A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: Moving an entity in his local direction using a global vector [Re: XD1v0] #299068
11/20/09 23:48
11/20/09 23:48
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
it works perfect! thank you so much laugh


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB

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