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
0 registered members (), 18,767 guests, and 5 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
"vec_" problem #171938
12/09/07 13:00
12/09/07 13:00
Joined: Feb 2007
Posts: 77
São Paulo, Brazil
AttosRH Offline OP
Junior Member
AttosRH  Offline OP
Junior Member

Joined: Feb 2007
Posts: 77
São Paulo, Brazil
hi all,

I was trying to create a simple gravity system based on AUM nº 52,
but I did'n understand what vec_set, vec_sub and vec_to_angle do
can someone help me?

ps: srry for the bad english lol

Re: "vec_" problem [Re: AttosRH] #171939
12/09/07 15:07
12/09/07 15:07
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Happy Birthday Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
a (gs-)vector is a array of 3 number
as example (3,5,-6)
you can access ever single number of an vector by vector.x/y/z but often you want to make the same operation with all 3 numbers, and that are the vector functions.

example for vec_set:
Code:
var v1[3]; //this is the first vector
var v2[3]; //the second vector

v1.x = v2.x;
v1.y = v2.y;
v1.z = v2.z;
//is the same as
vec_set(v1,v2);



example for vec_add:
Code:
var v1[3]; //this is the first vector
var v2[3]; //the second vector

v1.x += v2.x;
v1.y += v2.y;
v1.z += v2.z;
//is the same as
vec_add(v1,v2);



vec_to_angle takes a normal vector and converts it into degrees

for more information RTFM!!

Re: "vec_" problem [Re: Scorpion] #171940
12/09/07 17:45
12/09/07 17:45
Joined: Feb 2007
Posts: 77
São Paulo, Brazil
AttosRH Offline OP
Junior Member
AttosRH  Offline OP
Junior Member

Joined: Feb 2007
Posts: 77
São Paulo, Brazil
oh man thank you very much


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