PDA

View Full Version : Local coordsys and inverse mesh transform confusion

 Raeldor02-26-2006, 06:21 AMHi, I am a little confused. I imagined local object space would be affected by the pivot point of the object, yet when I do 'in coordsys local getvert mymesh 1' I get the same result regardless of the pivot point. In addition to this, if I do '(in coordsys world getvert mymesh 1) *(inverse mymesh.transform)' I get the values I was expecting to get. What gives here? Why is local object space not affected by the pivot? Is there an extra element at play here that is specific to max? Thanks
eek
02-26-2006, 08:56 AM
But your working with subojects: the vert, its local space is in relation to its object. And the object to its parent. I'll have to consult my master on this.

Bobo
02-26-2006, 04:18 PM
Hi,

I am a little confused. I imagined local object space would be affected by the pivot point of the object, yet when I do 'in coordsys local getvert mymesh 1' I get the same result regardless of the pivot point. In addition to this, if I do '(in coordsys world getvert mymesh 1)
*(inverse mymesh.transform)' I get the values I was expecting to get.

What gives here? Why is local object space not affected by the pivot? Is there an extra element at play here that is specific to max?

Thanks

The pivot point is a Node-level property. Object Space is independent of the pivot point. The pivot point offset is stored in a separate transformation matrix called the Object-Offset Transform. When the object space is transformed into world space, the vertex positions are multiplied by the object-offset, node transform and parent transform matrices. The combined matrix of these three is known as the object transform matrix.

Let's see a sphere primitive as example:
The Base Object takes the position [0,0,0] as the center and creates N vertices at distances equal to the radius around this origin. When you access local vertex positions, they will always be relative to the object's origin.

Then the vertices are passed up the stack - if there are any deformation modifiers like Bend and Twist, their positions will be affected in object space. Note that most modifiers have their own gizmo and center to define the modifier's space, but by default they are aligned to the object space.

Then we come to the node level where the vertices are multiplied by the object-offset matrix (thus resulting in an offset relatively to the pivot point), then multiplied by the node transform which transforms the vertices AND the pivot in parent space, and finally by the transformation of the parent (or the identity matrix if child of the world) to reach the final destination in the world space.

Check out the "Using Node Transform Properties" topic in the MAXScript Reference.

joconnell
02-26-2006, 04:48 PM
Heya Borislav - any word on the matrix dvd? I haven't learned anything new in a while so I'm looking forward to this one :)

Raeldor
02-26-2006, 04:51 PM
Thanks for the information. That makes a lot more sense now.

That's kind of different to programming 3d graphics where the model is usually just rotated relative to it's co-ordinates based origin.

Bobo
02-26-2006, 04:56 PM
Heya Borislav - any word on the matrix dvd? I haven't learned anything new in a while so I'm looking forward to this one :)

I finished recording a month ago, the material is being edited at the moment.
Please keep an eye on the CG Academy webpage for news in the next week or two...