Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Vector What??; This is eating me up..
Topic Started: Nov 11 2010, 06:03 PM (128 Views)
Docmesh
Newbie
[ * ]
Okay, so I have downloaded tons of examples and other things of people here using Vectors.. I am still so confused I have no clue what to do.

I understand some, but not all. If you guys can help me understand (I dont want hand outs)

Say I need a vector, okay in the object I need it I create it in the create event? I think..

Vector = CreateVector(-1,x,y,z) Now I know I must destroy this giving I passed -1. and x,y,z are the points of the vector they could be 8,10,20 for all it cares.. Right?

Then in a Step Event I can call this

Dist = CheckRayIntersection(Level,x,y,z,rotx,roty,0) <-- Where level is my model object/ 0 is the room.

Then..

CreateDirectionVector(Vector,rotx,roty);
CalculateVectorScalarProduct(Vector,Vector,Dist);
X=x+GetVector(Vector,1);
Y=y+GetVector(Vector,2);
Z=z+GetVector(Vector,3);

Now when I try to assign the X,Y,Z right above to an object I get an error unknown variable?
So is there something wrong?

Its sad when I darn near copy Mysteris scripts and just change my object names and they dont work LOL..
Edited by Docmesh, Nov 11 2010, 09:00 PM.
Offline Profile Quote Post Goto Top
 
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
Docmesh
Nov 11 2010, 06:03 PM
Okay, so I have downloaded tons of examples and other things of people here using Vectors.. I am still so confused I have no clue what to do.

I understand some, but not all. If you guys can help me understand (I dont want hand outs)

Say I need a vector, okay in the object I need it I create it in the create event? I think..

Vector = CreateVector(-1,x,y,z) Now I know I must destroy this giving I passed -1. and x,y,z are the points of the vector they could be 8,10,20 for all it cares.. Right?

Then in a Step Event I can call this

Dist = CheckRayIntersection(Level,x,y,z,rotx,roty,0) <-- Where level is my model object/ 0 is the room.

Then..

CreateDirectionVector(Vector,rotx,roty);
CalculateVectorScalarProduct(Vector,Vector,Dist);
X=x+GetVector(Vector,1);
Y=y+GetVector(Vector,2);
Z=z+GetVector(Vector,3);

Now when I try to assign the X,Y,Z right above to an object I get an error unknown variable?
So is there something wrong?

Its sad when I darn near copy Mysteris scripts and just change my object names and they dont work LOL..
make sure in the create event you initialize X,Y,Z set them to 0.
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply