MCPcopy Index your code
hub / github.com/processing/p5.js / multiplyAndNormalizePoint

Method multiplyAndNormalizePoint

src/math/Matrices/Matrix.js:1494–1500  ·  view source on GitHub ↗

* Applies a matrix to a vector. * The fourth component is set to 1. * Returns the result of dividing the 1st to 3rd components * of the result by the 4th component as a vector. * * This method multiplies the current matrix by a 4D vector (x, y, z, 1), * effectively transforming the

({ x, y, z })

Source from the content-addressed store, hash-verified

1492 * }
1493 */
1494 multiplyAndNormalizePoint({ x, y, z }) {
1495 const array = this.multiplyVec4(x, y, z, 1);
1496 array[0] /= array[3];
1497 array[1] /= array[3];
1498 array[2] /= array[3];
1499 return new Vector(array[0], array[1], array[2]);
1500 }
1501
1502 /**
1503 * Applies a matrix to a vector.

Callers 2

environmentFunction · 0.45
interactionFunction · 0.45

Calls 1

multiplyVec4Method · 0.95

Tested by

no test coverage detected