Scaling about an arbitrary point

The animated gif above shows the result of scaling an object about a point that is not the origin. This is like moving an object’s center and then scaling the object.

Here’s an ICE tree that scales an object (a cube in this example) about an arbitrary point.

I didn’t freeze the transforms on the cube, so I used a StaticKineState property to hold the initial SRT values. Otherwise, when I had the plugged into the tree, I ended up with some weird results sometimes.

A null named “pivot_position” is used to specify the scaling point.

First, we translate the scaling point back to the origin of the cube coord system.
Then we apply the scaling, and then we translate back to the “pivot position”.
Because the cube transforms weren’t frozen, I then multiple by the cube’s initial transfo matrix to get the final result.
On-Line Computer Graphics Notes

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s