Jump to content

where is the tutorial of Vectors?


Recommended Posts

That's not technically a tutorial - just an overview.

Vectors in script are just space-delimited strings in x y z order:

%x = 10;
%y = 44;
%z = 4;
%vector = %x SPC %y SPC %z; // compose vector from variables using the TS SPC helper
%plainVector = "10 44 4"; // the same vector using hardcoded values

Pretty much anything that is grouped like this is doable - rotations, vectors, x/y coordinates in GUI objects, etc.

And it now occurs to me that I should go ahead and start adding my documentation changes to pull requests on the https://github.com/RichardRanft/Torque3D-Documentation repo. That or start actively maintaining my live copy. Maybe that should be "and"....

Link to comment
Share on other sites

thanks rlranft, can you please do a practical example of vectors? how to use this in torque3d? with vectors I suppose I can move a player, I mean, tell the character to go to x y z, right? ahmm if I need to move the character 1 meters in front 2 meters to the left, with vector can do this?

Link to comment
Share on other sites

I think the basic problem is that you don't have much (if any) experience in vector and matrix mathematics. In order to do any programming in 3D-space (or even 2D) you really need to learn about this stuff. In fact, I'd say you need to be able to do 3d math as naturally as you would count to 10 (without using your finger).

Unfortunately, teaching this subject is a wee bit beyond what I think the members of the forum can do. In principal, you seem to have a good understanding of what vectors can be used for. Which is great; an intuitive understanding can help a lot here.

I'd recommend looking up some vector tutorials online and reading a bit more about the fundamentals.

Don't be put off by having to learn. I completely failed at school - you could't find somebody who was a worse student that me. But I was able to learn this stuff on my own in the evenings, while working on constructions sites during the day when I was 17/18. I'm pretty sure you can manage this without any problems.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...