Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
Stooq now requires an API key
by VHX. 06/08/26 20:14
ZorroGPT
by TipmyPip. 06/06/26 12:36
Zorro 3.01 recoded MMI function issue
by TipmyPip. 06/04/26 05:44
SGT_FW
by Aku_Aku. 05/31/26 11:05
Issues resuming trades on Demo account
by Martin_HH. 05/22/26 13:31
XTB
by pr0logic. 05/18/26 12:27
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 3,586 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Seraphinang, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Global vector from Local angles #275302
06/30/09 22:49
06/30/09 22:49
Joined: Jun 2009
Posts: 5
Plystire Offline OP
Newbie
Plystire  Offline OP
Newbie

Joined: Jun 2009
Posts: 5
Hello,

I'm trying to get a global normal vector based upon a model's angles.

I know I have pan, tilt and roll, and I know I need to use these to get what I am after, but I'm not sure how to go about it exactly.

My 3D Maths are rusted, lol.
I understand that I would be using cosine and sine to find the distances I am looking for and then adding those to the model's coordinates. I'm lost after that. Not sure what I would be sining and cosining to get the values I'm after.

I want to find the global coordinates that are 50 units below the model. When I say "below", I don't mean "50 units straight down", I mean in the direction that the bottom of the model is facing.

Geez, I'm so bad at explaining this. frown

If anyone understands what I'm trying to say here, can you please assist?

Thank you!


The one and only,
~Plystire
Re: Global vector from Local angles [Re: Plystire] #275305
06/30/09 23:21
06/30/09 23:21
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
wont vec_for_angle do?
Just scale it with 50.


Click and join the 3dgs irc community!
Room: #3dgs
Re: Global vector from Local angles [Re: Joozey] #275309
07/01/09 00:05
07/01/09 00:05
Joined: Jun 2009
Posts: 5
Plystire Offline OP
Newbie
Plystire  Offline OP
Newbie

Joined: Jun 2009
Posts: 5
I suppose, but that function assumes that I'm using a direction vector that's pointing forward. I'm using a direction vector that's pointing down, thus I would need to take the roll angle into consideration as well since it would also effect the vector.


The one and only,
~Plystire
Re: Global vector from Local angles [Re: Plystire] #275320
07/01/09 00:49
07/01/09 00:49
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Im not sure but somthing like this may be what you're after...
vec_rotate(normal, myentity.pan);
or possibly
vec_rotateaxis(normal, myentity.x, myentity.pan);


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Global vector from Local angles [Re: EvilSOB] #275335
07/01/09 02:22
07/01/09 02:22
Joined: Jun 2009
Posts: 5
Plystire Offline OP
Newbie
Plystire  Offline OP
Newbie

Joined: Jun 2009
Posts: 5
Ahhh, I think I found a command to do just what I want:

t_vector = vec_for_ent(vector(0,0,-50),me);


Maybe this will help someone else out in future searches.


I very much appreciate the assistance, guys! I would not have thought of looking for a command, so without coming here I might have persue'd the mathematical approach and wasted lots of time. lol


The one and only,
~Plystire
Re: Global vector from Local angles [Re: Plystire] #275599
07/01/09 23:16
07/01/09 23:16
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
heya, use
Code:
vec_set(your.x, my.x);
		vec_add(your.x, vec_rotate(vector(0, 0, 50), my.pan));

where you is the model being aligned below, and me, is the origin


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