I want to write a GLSLMat that rotates the instances on their normal.
I’d like to do the same as when, in the Geometry COMP, you pass the normals to the Rotate to Vector parameter, but in GLSL
I pass the position and normals through CHOPs to array uniforms.
I have no problem with the positions but when I use TDRotateToVector matrix it works as long as the N.y has positive values. If it’s negative, it’s like the matrix does the reverse rotation.
Here’s attached a sample showing the problem comparing the instancing on the Geo and on the GLSL material.
What am I missing?
Thanks a lot
V.RotateToVector_GLSL.1.toe (13.9 KB)