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 (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to divide Vector? #459865
06/09/16 12:41
06/09/16 12:41
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline 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?
Code:
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: CocaCola] #459866
06/09/16 12:50
06/09/16 12:50
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Make sure that you aren't deviding by zero.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: how to divide Vector? [Re: 3run] #459867
06/09/16 12:55
06/09/16 12:55
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline 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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
As the manual says, vertex position is stored in c.x,y,z
Originally Posted By: Manual
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);


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: how to divide Vector? [Re: 3run] #459871
06/09/16 14:58
06/09/16 14:58
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline 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.
Re: how to divide Vector? [Re: CocaCola] #459876
06/09/16 17:21
06/09/16 17:21
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
use vectors and not pointers to vectors. you are currently destroying random ram
.


Visit my site: www.masterq32.de

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