Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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