I am currently delving into the world of three.js and finding myself faced with a challenge. My goal is to multiply two translation matrices together in order to create a consolidated matrix that encapsulates both translations:
| 1 0 0 -2 | | 1 0 0 3 |
| 0 1 0 7 | * | 0 1 0 4 |
| 0 0 1 6 | | 0 0 1 6 |
| 0 0 0 1 | | 0 0 0 1 |
The matrix I was anticipating should look like this:
| 1 0 0 1 |
| 0 1 0 11 |
| 0 0 1 12 |
| 0 0 0 1 |
However, what I'm actually getting is:
| 1 0 0 0 |
| 0 1 0 0 |
| 0 0 1 0 |
| 1 11 12 1 |
To perform this multiplication, I am utilizing the Matrix4.multiply()
method provided by three.js:
var result = matrix1.multiply(matrix2);
If you'd like to witness this phenomenon firsthand, please take a moment to explore this jsfiddle demonstration.
Furthermore, if you are curious about the expected outcome, feel free to examine this WolframAlpha reference.
It appears I have not grasped the true essence of three.js's Matrix4.multiply()
method. Can someone shed light on its functionality and guide me towards achieving the desired output?