Movable pivot setup
The title says it all. It's a movable pivot for rotating and scaling. Inspired by this video.
Setup
pickMatrix
set to filter everything but translate. Using parentMatrix
here but it could be anything else. (zoom)
I wanted to avoid using any pivot
attributes. We're using matrix multiplication instead. This works by multiplying the pivot's translate matrix, inversed, with its worldMatirx
. So basically, we're translating back the object after the rotation/scaling is applied.
You can't orient the pivot with this setup; we'll need an extra transform object in order to do that. I wanted this setup to be as simple as possible.