STENDEC
- 21
- 0
Hello, apologies in advance if my questions seem rather ignorant. I'm trying my best (and struggling) to understand the topic, but my background in math is weak, and i need the math for artistic purposes.
I want to iteratively move and rotate a point in 3D space (move, rotate, move, rotate...) and from what I understand multiplication of 4x4 matrices lends itself to the task. The point has a direction it's pointing in (necessary for such motion); I take it that makes it a vector?
Let's say the point's position (Cartesian coordinates) is (2, 1.5, 3)
And the direction it points in is (1, 0, 0)
From what I understand, I first create a matrix that represents the current state:
Matrix1=<br /> \begin{bmatrix} <br /> 0 & 0 & 0 & 2 \\ <br /> 0 & 0 & 0 & 1.5 \\ <br /> 0 & 0 & 0 & 3 \\ <br /> 0 & 0 & 0 & 1 \end{bmatrix}
Is this matrix ok (maybe missing 1's in the first 3 columns?) or have I fundamentally misunderstood something?Next I have to create a matrix that transforms the location and rotation of the point/vector. Through my online searches I found this:
Matrix2=<br /> \begin{bmatrix} <br /> tx^2+c & txy-sz & txz+sy & X_{1} \\ <br /> txy+sz & ty^2+c & tyz-sx & Y_{1} \\ <br /> txz-sy & tyz-sx & tz^2+c & Z_{1} \\ <br /> 0 & 0 & 0 & 1 \end{bmatrix}
Where:
X_{1}, Y_{1}, Z_{1} is the desired translation in Cartesian coordinates, e.g. 0, 0, 3.75 to move 3.75 units along the system's z axis.
x, y, z are the unit vector (1, 0, 0 in my case)
c = cosθ
s = sinθ
t = 1-cosθ
Is the angle θ in degrees or radians, can you tell from looking at its usage?
1. Once I have constructed Matrix2, do I multiply it by Matrix1 to derive a Matrix3 which contains the new position/direction of my point?
2. How would i go about retrieving the new Cartesian coordinates (position and rotation) from Matrix3?
3a. If Matrix2 contains my desired transformation, can i repeatedly multiply it with the result of a prior multiplication (M3'=M3xM2, M3=M3', M3'=M3xM2...) to achieve my original goal of iterative translation (most likely resulting in a circle or helix)?
3b. If i had to feed Matrix2 a unit vector, wouldn't what comes in from Matrix3' during the next iteration be unsuitable?Again, sorry if i expose gaping holes in my comprehension. I hope my intentions make some sense.
Thanks!
I want to iteratively move and rotate a point in 3D space (move, rotate, move, rotate...) and from what I understand multiplication of 4x4 matrices lends itself to the task. The point has a direction it's pointing in (necessary for such motion); I take it that makes it a vector?
Let's say the point's position (Cartesian coordinates) is (2, 1.5, 3)
And the direction it points in is (1, 0, 0)
From what I understand, I first create a matrix that represents the current state:
Matrix1=<br /> \begin{bmatrix} <br /> 0 & 0 & 0 & 2 \\ <br /> 0 & 0 & 0 & 1.5 \\ <br /> 0 & 0 & 0 & 3 \\ <br /> 0 & 0 & 0 & 1 \end{bmatrix}
Is this matrix ok (maybe missing 1's in the first 3 columns?) or have I fundamentally misunderstood something?Next I have to create a matrix that transforms the location and rotation of the point/vector. Through my online searches I found this:
Matrix2=<br /> \begin{bmatrix} <br /> tx^2+c & txy-sz & txz+sy & X_{1} \\ <br /> txy+sz & ty^2+c & tyz-sx & Y_{1} \\ <br /> txz-sy & tyz-sx & tz^2+c & Z_{1} \\ <br /> 0 & 0 & 0 & 1 \end{bmatrix}
Where:
X_{1}, Y_{1}, Z_{1} is the desired translation in Cartesian coordinates, e.g. 0, 0, 3.75 to move 3.75 units along the system's z axis.
x, y, z are the unit vector (1, 0, 0 in my case)
c = cosθ
s = sinθ
t = 1-cosθ
Is the angle θ in degrees or radians, can you tell from looking at its usage?
1. Once I have constructed Matrix2, do I multiply it by Matrix1 to derive a Matrix3 which contains the new position/direction of my point?
2. How would i go about retrieving the new Cartesian coordinates (position and rotation) from Matrix3?
3a. If Matrix2 contains my desired transformation, can i repeatedly multiply it with the result of a prior multiplication (M3'=M3xM2, M3=M3', M3'=M3xM2...) to achieve my original goal of iterative translation (most likely resulting in a circle or helix)?
3b. If i had to feed Matrix2 a unit vector, wouldn't what comes in from Matrix3' during the next iteration be unsuitable?Again, sorry if i expose gaping holes in my comprehension. I hope my intentions make some sense.
Thanks!
Last edited: