2 registered members (AndrewAMD, Ayumi),
1,405
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
how to divide Vector?
#459865
06/09/16 12:41
06/09/16 12:41
|
Joined: Mar 2014
Posts: 359
CocaCola
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2014
Posts: 359
|
Hello, IŽd tried to divide 2 vectors, but it doesenŽt work. I get a E1513 Error. but I see the you model with I created What is wrong?
VECTOR* temp;
VECTOR* temp2;
CONTACT* c = ent_getvertex(you,NULL,i);
CONTACT* c2 = ent_getvertex(you,NULL,i-2);
while (1) {
if(key_space){
while(key_space)wait(1);
vec_set(temp.x,c2.x);
vec_set(temp2.x,c.x);
temp.x /=temp2.x;
temp.y /=temp2.y;
temp.z /=temp2.z;
}
wait(1);
}
Last edited by CocaCola; 06/09/16 12:42.
|
|
|
Re: how to divide Vector?
[Re: 3run]
#459867
06/09/16 12:55
06/09/16 12:55
|
Joined: Mar 2014
Posts: 359
CocaCola
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2014
Posts: 359
|
yes, it was that problem, THE nullvector X} whats about the c.v? ist the vertex position c.v or c.x?
Last edited by CocaCola; 06/09/16 12:56.
|
|
|
Re: how to divide Vector?
[Re: CocaCola]
#459869
06/09/16 13:21
06/09/16 13:21
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
As the manual says, vertex position is stored in c.x,y,z c.x,y,z - VECTOR containing the vertex position in local entity coordinates, set by ent_getvertex. Take a look into the manual, it's almost always helpful: ent_getvertex(ENTITY* ent, CONTACT* c, var num);
|
|
|
Re: how to divide Vector?
[Re: 3run]
#459871
06/09/16 14:58
06/09/16 14:58
|
Joined: Mar 2014
Posts: 359
CocaCola
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2014
Posts: 359
|
IŽm not shure with the read in the manual. OK? edit: I fond in the example: c.v.y += 5.0; edit2: my second problem was the * in the vector declaration
Last edited by CocaCola; 06/09/16 16:58.
|
|
|
|