#Vectors
1 messages · Page 1 of 1 (latest)
Vectors are literally just 3 floats put together to represent a "3D Number"
Basically, you have 3 coordinates, X, Y, and Z
fuck sake, i pressed enter
there’s two main types of vectors, positions, and directions.
positions are stored in a 3d world as X, Y, and Z. So if an objects position is 0, 1, 0, it is 1 meter above the origin of the room, which is 0, 0, 0. You can also visualize this by selecting an object then going to your palette and clicking “move”. This will show 3 arrows. The red one is the X axis, the green one is the Y axis, and the blue one is the Z axis.
directions are stored the same way as positions. If a player is looking at 0, 1, 0, they are looking straight up. Looking directly forward, would mean your Y axis is equal to 0. Looking down and its -1. You can visualize this with the “rotate” tool in your maker pen, all the colors are the same as the “move” tool.
Every vector has a magnitude. As far as I know, magnitude only matters when dealing with directional vectors. For example, “get velocity” will not output a float of how fast the input object/player is moving, rather, a directional vector which is the direction the object/player is moving in. You can then input this vector into “get magnitude” to see how fast they are moving. If you were to normalize it before inputting into “get magnitude”, it would always output 1 no matter how fast or slow the object/player moving. Normalizing the vector before using it can actually be beneficial. For example, if you wanted to make a sword that would fling people when you hit them, you could normalize the velocity of the sword before using it on “Velocity Add”. “Velocity add” will always multiply by the magnitude. Meaning if you swung at a speed of 2, the player would be flung 2 times as far. Normalizing it will make sure the magnitude is always 1, so this doesn’t happen.
@toxic stream @cyan wadi
Vectors are literally just 3 floats put together to represent a "3D Number"
Basically, you have 3 coordinates, X, Y, and Z
A Vector3 can represent a multitude of things, here are the most common ones:
- Position, where X, Y, and Z, are the distances from the world origin in meters
- Direction, imagine you drew a line from the world origin (0,0,0) to the Vector3 as a position, this is "Direction"
- Velocity (Similar to direction), where X, Y, and Z, define the direction, and the magnitude is the speed in m/s
- Rotation, where X, Y, and Z are the distances from the world rotation in degrees
- Angular velocity (Euler Angles), where X, Y, and Z is the rotation speed in deg/s around each axis
- Angular velocity (Angle Axis), where X, Y, and Z, represent an axis of which to rotate around, and the magnitude represents the rotation speed in m/s
The "Magnitude" of a vector is the distance the vector is from Position (0,0,0)
The magnitude of a vector is equal to sqrt(X^2 + Y^2 + Z^2)
"Normalizing" a vector means setting its magnitude to 1
When normalizing a vector, the direction stays the same, but the magnitude is always equal to 1
"World Origin" is the center of the world, Position (0,0,0)
"World Rotation" isnt really a good word in VR terms, but in unity terms it makes sense. The world rotation is Euler Angles (0,0,0), or more accurately said Direction (0,0,1) is forward, Direction (0,1,0) is up, and Direction (1,0,0) is right
More complicated stuff like Vector Cross and Vector Dot have been explained in the best, just search "cross" or "dot" in either messages OR threads for #1020094893458198578 and/or #circuits
Thank you so much!