We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3aad27 commit 6add2e7Copy full SHA for 6add2e7
1 file changed
src/nodes/materialx/MaterialXCore.js
@@ -27,7 +27,9 @@ export const mx_rotate3d = ( input, amount = 0, axis = vec3( 0, 1, 0 ) ) => {
27
const c = cos( rotationRadians );
28
const oc = sub( 1, c );
29
30
- // https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
+ // based on https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
31
+ // but the code in the Wikipedia article is for v' = M * v, where as
32
+ // MaterialX is v' = v * M, thus the order of parameters into the first cross are reversed
33
return input.mul( c )
34
.add( input.cross( normalizedAxis ).mul( s ) )
35
.add( normalizedAxis.mul( normalizedAxis.dot( input ).mul( oc ) ) );
0 commit comments