Author Topic: Need vector help [Not a question]  (Read 1010 times)

Hello all, I am currently working, and am almost finished with, an extremely in depth Torquescript tutorial that will be hosted on my own private web page.  Each tutorial covers a different topic and has a related YouTube video of me talking and doing the things in the tutorial for people that are more audible learners.

However, I never got into vectors, container searches, etc in Torquescript.  So my knowledge of these is minuscule to say the most.

If anyone would like to type up a 'report' on the above listed topic and/or do a recording of themselves to the tutorial they wrote, you will be 100% credited on the page it will be posted to.

If you cannot record yourself, I can do so myself so long as you write the tutorial.

Thanks.

I also would like to know what the heck a vector is

A vector is a direction. It is in the same format as position, except it represents direction. Lets say your velocity is "10 0 0"
You are moving forward 10. "10 0 0" is a vector representing your forward movement. Now this vector has a magnitude (speed) of 10. To get rid of the magnitude (make it 1) you can do vectorNormalize(vector);. Type %player.getEyeVector() in the console. This returns a vector based on your eye sight. The values will be around 1 or less, and that is because that vector has a magnitude of 1. Here is the code used to return a position 5 units in front of where you are facing
Code: [Select]
%position = %player.getPosition();
%vector = %player.getForwardVector();
//Make the magnitude 5
%vector = vectorScale(%player.getForwardVector(),5);
//Add it to my position
%finalPosition = vectorAdd(%position,%vector);
I know I didn't do that well of explaining it, but thats how I started understanding it lol.

A vector is not a direction
A unit vector is a direction

A vector is not a direction
A unit vector is a direction
I haven't been active for a while, but I've noticed that you never say anything productive or anything to prove your point. I stated above ways how you can make it a unit vector. And in this case that is completely irrelevent
« Last Edit: February 06, 2013, 05:22:56 PM by Plornt »

A vector is not a direction
A unit vector is a direction

If you want to get annoying and technical about it, a unit vector is not a direction either.

It's a direction plus a magnitude of one. A direction implies that you cannot have a distance - azimuth and elevation are examples of direction because the sun never changes position relative to you in Blockland.

Very much appreciated Plornt, would you mind doing something along the lines of what you just did for vectors for containersearch's, raycasts, most of the visible stuff in the game that I don't have time to study and perfect.

a unit vector is not a direction either.
crap I messed it up
:c