Johxz Posted March 29, 2015 Share Posted March 29, 2015 This is the math tutorial... someone has the vector tutorial? or a link about vectors in torquescripts? with example would be nice :roll: http://www.roostertailgames.com/TorqueRef/content/documentation/Scripting/Simple/Vectors.htmlThanks Quote Link to comment Share on other sites More sharing options...
rlranft Posted March 30, 2015 Share Posted March 30, 2015 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 valuesPretty 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".... Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 1, 2015 Author Share Posted April 1, 2015 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? Quote Link to comment Share on other sites More sharing options...
lowlevelsoul Posted April 1, 2015 Share Posted April 1, 2015 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. Quote Link to comment Share on other sites More sharing options...
Azaezel Posted April 1, 2015 Share Posted April 1, 2015 https://www.khanacademy.org/math/linear-algebra/vectors_and_spaces/vectors/v/vector-introduction-linear-algebra might be useful as well. Quote Link to comment Share on other sites More sharing options...
rlranft Posted April 2, 2015 Share Posted April 2, 2015 http://www.roostertailgames.com/TorqueRef/content/documentation/Scripting/Advanced/RTSPrototype.htmlUsing "vectors" to move AI units is in there, but it's buried in getting mouse click coordinates and AI moveTo() methods....And your mileage may vary - I've had a few go-'rounds with breakage because of updates to the Full Template. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.