Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Questions on terminology: associate geometry, reference geometry, and cluster geometry?

13 REPLIES 13
Reply
Message 1 of 14
thegeneralsolution
788 Views, 13 Replies

Questions on terminology: associate geometry, reference geometry, and cluster geometry?

When computing cluster deformation in the ViewScene example code, it uses 3 different types of transformations (or "geometries"): associate, reference, and cluster.

In the documentation's description of the cluster class, there is a function getAssociateModel that returns a node. The remark beneath the function reads:

If set, the associate model is the node used as a reference to measure the relative displacement of the link node. Otherwise, the displacement of the link node is measured relative the the node containing the control points. Typically, the associate model node is the parent of the bone a skin is attached to.


Okay that makes sense. But what are the reference and cluster geometry, and how do they relate to the associate model?

Also, is "model" just another word for a node?

I'd appreciate any help. Thanks!
13 REPLIES 13
Message 2 of 14

So, I know that the way skinning usually works is as follows.

Given the following two matrices:

initialMeshToBoneMatrix (convert from mesh space in bind pose, to local bone space)
currentBoneMatrix (bone location at current point in time)

the final transformation is:

finalTransformation = currentBoneMatrix*initialMeshToBoneMatrix (or reverse, depending on order of matrix multiplication)

So, in the code for cluster deformation (in ViewScene/DrawScene.cxx), I'm tempted to assert that associate geometry is the 'currentBoneMatrix', the reference geometry is the 'initialToBoneMatrix' and cluster geometry is the 'finalTransformatin'

Do I have the right idea here?
Message 3 of 14

No, the calculation you described only works for smooth binding. Associate Model is only used for rigid binding.
The correspondence in terms of ViewScene is:
currentBoneMatrix is "lClusterGlobalCurrentPosition = GetGlobalPosition(pCluster->GetLink(), pTime, pPose);"

initialMeshToBoneMatrix is "lClusterRelativeInitPosition".
Message 4 of 14

Cluster is not a geometry, it is a deformer that deform geometry, and that geometry is the "reference".
Associate model is only used for rigid binding, in other word, cluster with eAdditive mode.

For smooth binding, you only need reference and cluster, and each cluster will affect all vertices of the reference(the geometry).
But for rigid binding, each cluster only affect part of the vertices of the reference(the geometry). But when you move the root joint, the whole geometry should move, but the root joint actually only can deform part of the vertices, how can we reach that? Here we need the associate model, it generally the parent of current bone.
For example, joint1 is parent of joint2, joint 2 is parent of joint3. When you are process joint2, then joint1 is its associate model. In this way, the deformation of certain joint is always calculated relative to its parent object's space.

This is quite complex and hard to explain clearly by plain text. I am writing an complete FAQ about this with sample files, illustrations and maybe even videos. So please wait for that if you need more details.
Message 5 of 14

Thank you for your help, once again!

One point of confusion I often have regarding the SDK is how much of the terminology and structure is standard graphics theory, or specific to the FBX SDK.

You mentioned Rigid vs. Smooth deformation. The link below gives some nice details about smooth and rigid skinning.
http://graphics.ucsd.edu/courses/cse169_w05/3-Skin.htm

I'm going to read it carefully and hopefully it will enhance my understanding. But it uses slightly different terminology; it doesn't mention things like 'clusters' or 'associate models'.

Certainly the FBX documentation/FAQ shouldn't have to teach you all the graphics theory, but it should definitly tell you what theory/approach is being used, and how the classes and data structures correspond to that approach.
Message 6 of 14

I am afraid for skinning it is not that easy to construct that type of correspondence.
Cluster and Associate Model are something make more sense for implementation.
But graphics theory seldom discuss this type of implementation details.

Most FBX concepts can be easily mapped to its graphics theory equivalence or at lease can be mapped to concepts in Motion Builder, Maya or 3ds Max, but If you find any other case that could be improved, please do let us know.
Thanks for keep providing good suggestions. 🙂
Message 7 of 14

This is a very rough first draft about "Binding In FBX".
It only explains binding from the perspective of file now, next step would be to associate them with cluster codes in ViewScene.

Any questions, suggestions and feedback are welcome.

bindinginfbx.zip

Message 8 of 14

Awesome!

I have a final exam to study for but once that's over I'll be on break and will have plenty of time to look at this in detail!

Thanks so much for writing that up!
Message 9 of 14

So I went over the explanation very carefully. Here are some questions/unclear points.

First, when you do the Rigid Bind, I presume you manually assigned specific vertices to specific joints? If so, it may be worth mentioning what was done in Maya here before exporting.

Next:
You may already noticed the one cluster is marked as "RigidBind" ( check its UserData ), it is the real cluster that describes how joint1 will affect/deform the geometry.


When you say "it is the real cluster" the world 'real' here seems a bit vague. Maybe that sentence could be rephrased to be a bit more clear.

So if user moves joint3 even more after Figure 2, the final position should be sum of Figure 2 and the deformation value from this new movement.


"sum of Figure 2" again seems a bit sloppy and vague with the words.

But most important is this part:

This won't be explicitly discussed in most graphics theory of rigid binding because it is simply an combination of binding and parenting, but most 3D software do implement rigid binding this way.
There is no exception for FBX, so we add compensation cluster to imitate this behavior. That's why joint1 and joint2 will have two clusters corresponding with each of them, since joint4 do not really participate in the rigid binding, it does not influence any vertices, there is no need for joint3 to have a compensate cluster.


You say "so we add compensation cluster to imitate this behavior" but you don't really say how it imitates it. I think it would be more clear if you explained how the compensation works. Piecing together everything you said, my understanding is "A compensation cluster for a given joint, is a deformer to influence the vertices bound to its child joint(s), so they inherit its position accordingly." Is this correct?

This raises a question for me though. Suppose a given joint (call it joint A) has dozens of child joints, all rigidly bound to certain vertices. Will the compensation cluster for joint A apply to all of these vertices all the way down the tree? Or just to vertcies of its own child joints?

Your description of the associate model seems pretty clear, actually. The only slightly confusing part is the FBX file snippet:
This is also reflected in FBX file, the following object-property connection describe it:
;Model::joint1, SubDeformer::
C: "OP",740700896,701364304, "SrcModelReference"

;Model::joint2, SubDeformer::
C: "OP",740703088,701360656, "SrcModelReference"


So, the FBX file has to keep track of if an associate model is being used? Why is it called "SrcModelReference" and not "associate model"? What if no associate model is given in the file?

Overal, its a little confusing in some spots, but I think it helped me quite a lot with my understanding.
Message 10 of 14

Thanks for reviewing it! Will improve the "Real cluster" and "sum of Figure 2" in some way.

Here are some quick answers regarding your questions:
1. In Maya you do not need to manually assign specific vertices to specific joint. Maya has its own algorithm to automatically help you assign them, for example, according to the distance between the vertices and joint. Each 3D software could have their own algorithm and expose different parameters on UI for user to control the rigid binding, but that's usage of Maya or other 3D software. Should not be included in an FBX document.
Please keep in mind that FBX is just something to store and exchange, itself does not do much about graphics algorithm.

2. JointA will only need to compensate for the child right below it, because this compensation mechanism is recursive. JointA compensate for jointB, and jointB compensate for jointC, etc. So when you move jointA, they will be affected in a chain.

3. SrcModelReference is just the name of the property that is used as an implementation of associate model the concept in FBX file.
I don't know why it is named differently at the first place but it is not hard to match them as long as they are properly documented.
If there is no associate model when there should be, then that's bug of the exporter or creator who generate the FBX file and we say the file is corrupted.
But if there is only smooth binding in the original scene, then that's totally fine there is no associate model in the exported FBX file.
Message 11 of 14

Thanks for the clarifications!

I think the structure will become even clearer to me/us as I come to understand the ViewScene implementation better.

Can't wait to see the next part of this tutorial! Hope to see it soon!
Message 12 of 14

Hi, Jiayang Xu!

I've been trying to avoid asking unnecessary questions relating to this topic since you're writing an FAQ. I was just wondering, do you have estimate for when the update will be posted? I don't mean to rush or pester, I just wondered if I should keep trying to figure things out on my own, or if there's an update very soon and I should just wait for it.
Message 13 of 14

Sorry I won't have time for the part2 of that FAQ recently and myself still have some questions about the code in Viewscene related to rigid binding/associate model, that will also take me some time to figure out.
So it would be more meaningful that you can do your investigation at the same time from now on.

And I don't think this will block you from really doing something for binding, because as far as I know, smooth binding is used much more than rigid binding in production and the smooth binding part is pretty clear in Viewscene sample.

So my answer is: please go ahead and begin investigation/implementation. 🙂
Message 14 of 14

After reading your FAQ draft, and reviewing the code quite a bit, I think I have a pretty close understanding of whats going on.

But I'm still struggling to understand one little detail. It makes total sense that if you have two transformations, Initial and Current, and you want to compute the shift from Initial to Current, you're looking for the matrix M such that Current= M*Initial. So solving gives M = Current*Initial^(-1).

This is exactly how the shift works in ViewScene, for the link(or cluster) transformation. Inverse of initial, multiplied by current. Makes perfect sense.

What I cannot figure out is why the associate model uses inverse of the current transformation, multiplied by the initial transformation. (See code below) That appears to be shifting the associate model in the opposite direction! (from current to initial, instead of initial to current)


// Compute the shift of the link relative to the reference.
//ModelM-1 * AssoM * AssoGX-1 * LinkGX * LinkM-1*ModelM
pVertexTransformMatrix = lReferenceGlobalInitPosition.Inverse() * lAssociateGlobalInitPosition * lAssociateGlobalCurrentPosition.Inverse() *
lClusterGlobalCurrentPosition * lClusterGlobalInitPosition.Inverse() * lReferenceGlobalInitPosition;
}


Jiayang Xu, I know you said you still have some confusion yourself over the viewscene code and associate model, but do you understand why it moves from current back to initial for the associate model?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report