Results 1 to 6 of 6

Thread: Skinning formula

  1. #1

    Skinning formula

    Hello,

    I'm trying to use skinning with collada and OSG. That's my first skinning
    experience.

    The formula is given p 4-8 as:

    outv = \Sum_i { ((v * BSM) * IBMi * JMi) * JW }

    However v is in R^3 and BSM in R^{4x4} so the matrix product is not valid.

    Am I missing something? What is the full formula?

    I would have expected v to be replaced by [v(0) v(1) v(2) 1] but from my
    tests with OSG, it seems more like [v(0) v(1) v(2) 0]. As a consequence
    one cannot move the vertices located at [0 0 0].

    Am I right? Is there a reason for this choice?

    I'm trying to display forces (vectors in R^3) as animated arrows. My plan
    is to attach a node to the tip of the arrow, and to translate it according
    to the vector value.
    In order to do this, I need to discard the orientation of the node, thus the
    need for [0,0,0]-located vertices.

    Here is a working (in OSG) example, illustrating this idea. The arrow is
    a simple 2-vertices line.

    http://gist.github.com/610049#file_skin_transl.dae

    Here is a non-working one, where the vertex at [0,0,0] does not move.

    http://gist.github.com/610049#file_skin ... orking.dae

    Maybe it would be simpler to scale and rotate the arrow. How would you do that?
    Using matrix and scale? Or lookat and scale? Or rotate and scale (what happens
    when the rotation axis is [0 0 0])?

    Thank you for any insight.

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Skinning formula

    quick hints...

    * COLLADA spec generally describes column-major matrix math. This description appears to be row-major (a spec bug).
    * Difference between translating a point and a vector i.e. affine vs linear transformation.

  3. #3

    Re: Skinning formula

    Quote Originally Posted by marcus
    quick hints...
    Hi Marcus, thank you for you time, again...

    Quote Originally Posted by marcus
    * COLLADA spec generally describes column-major matrix math. This description appears to be row-major (a spec bug).
    I'm not sure to understand what you mean. I believed row/column-majorness was only a matter of storing matrices in linear memory (ie. a matter of software implementation), and that matrix math always (both in French and English speaking countries) used A(i, j) to identify the element at i-iest row and j-iest column. I am right?

    Maybe what you mean is that in this formula, v is a row-vector (in R^{1x3}) and not a column-vector (in R^{3x1}) as in the rest of the document. Am I right also?

    Quote Originally Posted by marcus
    * Difference between translating a point and a vector i.e. affine vs linear transformation.
    Here is what I understood on this matter.

    Let H = [R p ; 0 0 0 1] in R^{4x4}, with R in R^{3x3} (or SO(3)),

    Mapping a point v through H gives R*v +p.
    Mapping a vector v through H gives R*v. There is no translation. I don't know what you mean with "translating a vector".

    Point and vector mapping can be expressed in a way that is consistent with matrix math with homogenous coordinates:
    * the homogeneous coordinates of a point v are [v(0) v(1) v(2) 1]
    * the homogeneous coordinates of a ("free") vector v are [v(0) v(1) v(2) 0]

    Here is how I understand the problem so far:
    - the raw skinning formula exhibits invalid matrix math
    - this formula could be valid if one was using homogeneous coordinates (which is not explicitly stated)
    - when using homogeneous coordinates, the spec does not specify if the skinned vertices are points or vectors.

    Do you agree with this status?

    Are they point or vector?

  4. #4
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Skinning formula

    Quote Originally Posted by sbarthelemy
    Maybe what you mean is that in this formula, v is a row-vector (in R^{1x3}) and not a column-vector (in R^{3x1}) as in the rest of the document. Am I right also?
    Right and that equation is therefore the transpose of one using a column-vector.

    Quote Originally Posted by sbarthelemy
    I don't know what you mean with "translating a vector"...
    Right. I meant a homogeneous coordinate in a linear transformation where translation occurs.

  5. #5

    Re: Skinning formula

    Quote Originally Posted by marcus
    Quote Originally Posted by sbarthelemy
    Maybe what you mean is that in this formula, v is a row-vector (in R^{1x3}) and not a column-vector (in R^{3x1}) as in the rest of the document. Am I right also?
    Right and that equation is therefore the transpose of one using a column-vector.
    ok, on this matter I follow you. Sorry for being so picky. I think my loose english does not help here.

    Quote Originally Posted by marcus
    Quote Originally Posted by sbarthelemy
    I don't know what you mean with "translating a vector"...
    Right. I meant a homogeneous coordinate in a linear transformation where translation occurs.
    Sorry, I don't understand this new sentence.

    Quote Originally Posted by sbarthelemy
    Here is how I understand the problem so far:
    - the raw skinning formula exhibits invalid matrix math
    - this formula could be valid if one was using homogeneous coordinates (which is not explicitly stated)
    - when using homogeneous coordinates, the spec does not specify if the skinned vertices are points or vectors.

    Do you agree with this status?

    Are they point or vector?
    You haven't replied to this part. I still don't know if vertices are points (in which case OSG implementation is probably erroneous) or vectors. Or is the decision unspecified (viewer-dependant?).

    I think the formula could be clarified by using the homogeneous coordinates explicitly.

  6. #6
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Skinning formula

    Quote Originally Posted by sbarthelemy
    Quote Originally Posted by marcus
    Right. I meant a homogeneous coordinate in a linear transformation where translation occurs.
    Sorry, I don't understand this new sentence.
    I'm just restating what you said in the context of a translation that is only affine [x,y,z,0] vs linear [x,y,z,1] transformation. I think you understand it.
    Quote Originally Posted by sbarthelemy
    I still don't know if vertices are points (in which case OSG implementation is probably erroneous) or vectors. Or is the decision unspecified (viewer-dependant?).

    I think the formula could be clarified by using the homogeneous coordinates explicitly.
    I think the answer is that it can be either depending on the use-case and semantics. For example, skinning vertex positions will use homogeneous coordinates of the form [x,y,z,1] while skinning normals and tangents will expand to [i,j,k,0]. In other words, it's a distinction between a position vector and a direction vector.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •