Skip to main content
gamedev.net
🔒 Locked

Matrix problem

Started by Wibbs Nov 27, 2011 at 1:48 PM 1 replies 1.5k views
Original Post
Wibbs
Wibbs
Hey all,

I have a matrix problem that I've been trying to work out for about a week now but with no success, and I was hoping someone might beable to shed some light on it for me.

I have a scene graph where individual nodes store their scale, rotation and translation relative to their parent node. I also store the total forward and reverse transformation for each node so I can convert freely between global and local coordinates.

What I am struggling with is how to rotate a particular node around an arbitrary point in global coordinates. I know how to get:
- The matrix that represents the rotation about the point in global coordinates(Trans(-point) * Rotate * Trans(point)
- The global coordinates of the node I want to rotate

What I don't understand how to calculate is the change in local scale, rotation and translation for the node being rotated that gives the equivalent transformation.

Any help would be greatly appreciated.

Wibbs
Ripiz
Ripiz
Do you mean rotating around point (10, 5, 0) for example?
If yes, then translate, rotate, and translate back (Translate(10, 5, 0) * Rotate(x, y, z) * Translate(-10, 5, 0))
GustavoCanedo
GustavoCanedo

Do you mean rotating around point (10, 5, 0) for example?
If yes, then translate, rotate, and translate back (Translate(10, 5, 0) * Rotate(x, y, z) * Translate(-10, 5, 0))


I think that isn't the problem. And another way to do this with one operation:
fbaee547c3c65ad3d48112502363378a.png

u = [ux,uy,uz] = unitary translation vector.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.