Hi,
I'm trying to reproduce this in scene nodes
However, I'm having some trouble with this bit:
Particularly the matrix rotation. I have the bitangent, I have the theta. But I can't figure out how to get a matrix and rotate it using the bitangent and theta. I'm guessing for the last line I can use Transform vector with that matrix, but I'm not absolutely sure about it.
But the main problem is the matrix. How do I do that in scene nodes? I tried matrix from axis giving bitangent as the axis and theta as the rotation, but it gives completely different results than what I get in Houdini. Bitangent and theta I got to the same values as in Houdini, so the problem must be building and rotating that matrix.
Edit: Well, I guess my solution for the last line, to use Transform Vector, could also be wrong and that's why I'm getting the wrong values? But as far as I understand, multiplying a matrix by a vector means you're rotating that vector? So that's why I assumed it's correct...
Edit again: It SEEMS that actually I may have actually got the matrix correct. I get the same matrices in Houdini... or at least, I think.
For example, this what I get from one of the matrices in Houdini:
[ 0.933975, -0.32385, -0.151037, 0.0, 0.3571, 0.830432, 0.427623, 0.0, -0.0130599, -0.453325, 0.89125, 0.0, 0.0, 0.0, 0.0, 1.0 ]
And this the matrix for the same point in C4D:
Is it the same thing? I mean the values are there, but are they in the right positions?
If they're correct, then I can only assume that my interpretation of the last line is incorrect. How do I do that rotmat * normals[k]?