Skip to content

Multiplying matrices in MotionBuilder?

June 1, 2012

Charles

For the life of me I can’t figure this out – If I have a null and a cube at the origin, with the cube rotated and the null placed at [0,20,0] – Setting the nulls transform by multiplying it by that of the cubes should put it into the coordinate space of the cubes. (Essentially orbiting it about the cube)

This doesn’t appear to be the case though, as it appears to be doing the transformation in-place I.e. doing the transform with the first 3 rows and then adding the position part 4th row.

from pyfbsdk import *
box = FBFindModelByName('Cube')
null = FBFindModelByName('Null')

k = FBMatrix()
box.GetMatrix(k)

j = FBMatrix()
null.GetMatrix(j)

m = FBMatrix(j * k)
null.SetMatrix(m)

EDIT:

Just found out the FBMatrixMult – seems to do the job.

Advertisements
No comments yet

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: