Page 1 of 1

OCTANE and MODO's "row vector convention"

Posted: Tue Jun 23, 2015 11:30 pm
by jtmsf
Is MODO row vector convention different from OCTANE's? It seems like OCTANE's 4x4 transformation matrix is MODO's 4x4 transformation matrix TRANSPOSED. Is this correct?

Thanks

Re: OCTANE and MODO's "row vector convention"

Posted: Wed Jun 24, 2015 12:05 am
by face_off
Depends which transform you are referring to (particle, mesh item, texture?). In Modo Y is up - so Modo and Octane have the same coordinate system. A 4x4 CLxUser_Matrix from the Modo API gets converted to an Octane Scatter (3 x 4) transform as follows:

Code: Select all

	ScatterTransform[0] = ModoTransformMatrix[0][0]
	ScatterTransform[1] = ModoTransformMatrix[1][0]
	ScatterTransform[2] = ModoTransformMatrix[2][0]
	ScatterTransform[3] = ModoTransformMatrix[3][0]
	ScatterTransform[4] = ModoTransformMatrix[0][1]
	ScatterTransform[5] = ModoTransformMatrix[1][1]
	ScatterTransform[6] = ModoTransformMatrix[2][1]
	ScatterTransform[7] = ModoTransformMatrix[3][1]
	ScatterTransform[8] = ModoTransformMatrix[0][2]
	ScatterTransform[9] = ModoTransformMatrix[1][2]
	ScatterTransform[10] = ModoTransformMatrix[2][2]
	ScatterTransform[11] = ModoTransformMatrix[3][2]
Paul

Re: OCTANE and MODO's "row vector convention"

Posted: Wed Jun 24, 2015 1:23 am
by jtmsf
OCTANE (3x4) is a (4x4) with the last row (0,0,0,1) omitted, right?

Sorry, forgot to mention. I was referring to mesh item transforms. In modo the last row of the (4x4) matrix is (Posx, Posy, Posz, 1) and in octane the (Posx Posy Posz) is the last column of the 3x4 matrix?

Re: OCTANE and MODO's "row vector convention"

Posted: Wed Jun 24, 2015 1:51 am
by face_off
OCTANE (3x4) is a (4x4) with the last row (0,0,0,1) omitted, right?
Correct
Sorry, forgot to mention. I was referring to mesh item transforms. In modo the last row of the (4x4) matrix is (Posx, Posy, Posz, 1) and in octane the (Posx Posy Posz) is the last column of the 3x4 matrix?
Posx, Posy, Posz, 1 is the last column of a standard Transformation matrix. Perhaps you have the rows and columns mixed up in Modo.

Paul

Re: OCTANE and MODO's "row vector convention"

Posted: Wed Jun 24, 2015 5:55 pm
by jtmsf
Ok. So OCTANE uses "row-major" ordering. Then it's possible that MODO uses "column-major" ordering (like OPENGL?!). I'm trying to do some scripting, and this came up.

I have to put this question in The Foundry's forum. Sorry for the inconvenience.

Thanks

Re: OCTANE and MODO's "row vector convention"

Posted: Wed Jun 24, 2015 9:49 pm
by face_off
I should be easy to work out. If an item is scaled to 100%, Octane needs the first 3 rows to be something like:

Code: Select all

1 somevalue somevalue trans_x
somevalue 1 somevalue trans_y
somevalue somevalue 1 trans_z
Paul