Quote:Original post by M2tM
This may help, it's basically exactly what I do in opengl for rotating around a specified origin:
*** Source Snippet Removed ***
NOTE: atOrigin() is a function that basically checks to see if the vector is 0, 0, 0
See the rotate part? That's where you can specify to rotate around a specified origin.
However you do that in directx would be it.
Not sure if this is helpful. I store objects with a local translation and scale value and then also a rotation value and a rotation origin. That is what all these points relate to... It sounds like you're already doing this though and the problem lies with your shader (which I am not familiar with), so this is more an explanation to the people asking you why you're doing what you are.
Thats what I'm already doing, I translate it to the origin I want then I multiply it by the rotation and then move it back to it's original position.
Thats at "// I thought the code below would give the matrix the correct center of rotation but it's still at the origin." which is actually working but it's not moving it to the right origin or something else is wrong thats making it the wrong origin, idk...