- Home /
How to change Point of Application of a vector?
Hi all, As you know, in Unity we can create vector in 3D, using vector3. If I write new vector3(2f,2f,0f) I create a vector that start from origin (0f,0f,0f) and end to (2f,2f,0f) coordinates. I don't want that my vector start from origin, I want start it from (2f,0f,0f) and end to (2f,2f,0f). Is it possible?? Thank you
It's not exactly true that the vector starts at (0f, 0f, 0f), a Vector only has a magnitude and direction, which is described in the terms of (x,y,z) in case of Vector3. Once you apply it to something with a position it will act relative to that position.
In your example you are just talking about a vector (0,2,0), just it would be applied at (2,0,0).
Therefore it would be helpful if you described what are you actually trying to achieve.
Hi, I have to descrive the centre of Pressure (COP) of a foot. I have 2 Pressure sensors on a foot and I can misure 2 vertical Forces. $$anonymous$$y goal is calculate COP of the foot and have magnitude, angle of the vector applyed to the COP.
Edit1) the 2 forces has different module due to the baricenter position of the human body.
You need to distinguish between line segments, rays, and vectors. Line segments have two positions. Rays have a position and direction (and can constructed and manipulated using Unity's Ray class). Vectors have direction and magnitude.
Not sure what you need, but you can add and subtract vectors. So if you want a Vector for what you describe:
Vector3 dir = Vector3(2f,2f,0f) - Vector3(2f,0f,0f);
I try this solution but Vector dir become (0f,2f,0f), ins$$anonymous$$d I want (2f,2f,0f)
Answer by flaviusxvii · Aug 29, 2014 at 04:46 PM
You are describing a line segment in 3D space, from 2,0,0 to 2,2,0. You'd use two Vector3's to track this information, each point being stored relative to the origin. If you later want to know how these two points in space relate to eachother you can subtract one from the other to get the Vector3 between them.
I'd suggest reading up on Linear Algebra to get a sense of http://en.wikipedia.org/wiki/Basis_(linear_algebra)
$$anonymous$$aybe now the problem is more clear. I don't have to understund vector3 like a Force, isn't true?