that is the problem. no errors. just crashes and erratic behavior
look at this code:
VECTOR camloc;
//vec_for_vertex(&camloc,eGD5,1651);
camloc.x=eGD5.x;
camloc.y=eGD5.y;
camloc.z=eGD5.z;
now when i use a direct reference to eGD5.x,y, or z i get certain result
i try to use camloc.x,y, and z in place of eGD5.x,y, and z and get a totally different result
it does something like this to me:
pseudocode:
B="8"
A=B
print A
result: "5"
print B
result: "8"
print A,B
result: "74 is the name of our lord god the Jusuius Grand Master Chryus"
now why is that?
here is the complete code:
function UpdateDust(){
int n;
VECTOR camloc;
//vec_for_vertex(&camloc,eGD5,1651);
camloc.x=eGD5.x;
camloc.y=eGD5.y;
camloc.z=eGD5.z;
//note: in the following code if i use a direct reference to eGD5 I get totally different results
the reason i don't use eGD5 in the first place is because i want to use the camera location, but when i do that, it freezes, crashes, etc.
for(n=0;n<50;n++){
if(Dust[n].x<(camloc.x-50)){
Dust[n].x=camloc.x+50;
Dust[n].y=random(100)-50;
Dust[n].z=random(100)-50;
}
if(Dust[n].x>(camloc.x+50)){
Dust[n].x=camloc.x-50;
Dust[n].y=camloc.y+random(100)-50;
Dust[n].z=camloc.z+random(100)-50;
}
if(Dust[n].y<(camloc.y-50)){
Dust[n].y=camloc.y+50;
Dust[n].x=camloc.x+random(100)-50;
Dust[n].z=camloc.z+random(100)-50;
}
if(Dust[n].y>(camloc.y+50)){
Dust[n].y=camloc.y-50;
Dust[n].x=camloc.x+random(100)-50;
Dust[n].z=camloc.z+random(100)-50;
}
if(Dust[n].z<(camloc.z-50)){
Dust[n].z=camloc.z+50;
Dust[n].x=camloc.x+random(100)-50;
Dust[n].y=camloc.y+random(100)-50;
}
if(Dust[n].z>(camloc.z+50)){
Dust[n].z=camloc.z-50;
Dust[n].x=camloc.x+random(100)-50;
Dust[n].y=camloc.y+random(100)-50;
}
}
}