Home General Discussion

matrix math quickie for artists

polycounter lvl 20
Offline / Send Message
CrazyButcher polycounter lvl 20
I quickly threw together a mini faq on matrix maths (this is not indepth just a fast read thru) and still would like to add to it, sort out things that are unclear (or wrong).
dejawolf might do a nicer version of it with proper illustration and not the lacking ascii art.

Give it a try and please give me feedback
http://www.cs.uni-magdeburg.de/~kubisch/docs/matrixqfaq.txt

It should help you getting an idea of what it is, does, and whenever you stumble about it in mel or maxscript or whatever, that you as artist have some kind of knowledge about it.

I would like not to blow it up too much, however I remember a discussion about a tutorial for artists on shaders, and that would involve vector/matrix math as well...

If you really want to know more maths behind it I suggest this
http://skal.planet-d.net/demo/matrixfaq.htm

Replies

  • KDR_11k
    Offline / Send Message
    KDR_11k polycounter lvl 18
    So THAT's what OpenGL does with the fourth column!

    I disagree on the hierarchy depth of the skeleton, since hierarchies are usually handled recursively each bone matrix would be computated only once and would require only one multiplication (local matrix multiplied with parent matrix) to do so. The root bone would still have its local matrix multiplied with the object's matrix so each bone should have constant time for computing the matrix regardless of hierarchy shape.

    And you missed the third column in

    <font class="small">Code:</font><hr /><pre>1 0 0 a 1 0 -a
    0 1 0 b becomes 0 1 -b
    0 0 1 c 0 0 -c</pre><hr />
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    While this effort is commendable, I think the fact that it's all in a .txt file will send 99% of artists running screaming for the hills smile.gif
  • Jeff Parrott
    Offline / Send Message
    Jeff Parrott polycounter lvl 19
    I'm having flashbacks to my discrete math college course.
  • KDR_11k
    Offline / Send Message
    KDR_11k polycounter lvl 18
    You had matrix operations in discrete maths? That's linear algebra at my university.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    thanks kdr, and you are right if all bones have keys the execution is the same. I just wanted to show that once you start modifiying "just the root" that all children require the update (although their locals werent changed).

    and mop you are right, a well illustrated paper should be done, especially as it could be done very well... will see if I can find more time for it. But considering it's for artists, the lack of colors and images is kinda striking wink.gif
  • KDR_11k
    Offline / Send Message
    KDR_11k polycounter lvl 18
    You have to recompute all matrices if the object or the player moves so I don't think any engine does selective recomputation for that. Unless the bone matrices are stored in relation to the object origin but that'd require you to multiply each of them with the object's matrix every frame and that wouldn't take any less time (in fact it'd take more) than multiplying the bone's matrix with the parent matrix (one operation per bone vs. one operation per changed bone plus one operation per bone).
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    you can store them relative to object origin just fine, when using the modelview matrix to put them at the proper place in the world when rendering. That is if you dont need the bones result as world matrix. Say you have multiple soldiers with same animations, when its object relative, you can share their matrices for all soldiers that are in the same frame.
    When you dont think of them running as animation and being all updated every time, it makes sense to only recompute the branch that is affected, and not the whole tree. Most scenegraphs will work like this.

    However as most artists probably deal with fullbody animations and dont go overboard with too complex skeletons (for the sake of usability) this hardly ever is a problem. Cause then as you said, we hardly ever have partial updates and will just fly over all anyway.


    edit:
    I updated the faq accordingly
  • KDR_11k
    Offline / Send Message
    KDR_11k polycounter lvl 18
    you can store them relative to object origin just fine, when using the modelview matrix to put them at the proper place in the world when rendering.

    That's another matrix operation. It's done by the API (and probably in the GPU) but it's another matrix op.
  • Zergxes
    Offline / Send Message
    Zergxes polycounter lvl 18
    Yeah, that gave me flashbacks of Algebra3/Precalc. Cool read. I've always been curious what the heck is going on under the hood of games and 3d apps. I agree with MoP though, I would buy a book of this only if it had more pictures. Or if there was a puppet show.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    yes, kdr, but that op doesnt cost you anything, because you dont have to multiply all your bones with it. And you need to transform your vertices to camera anyway... so it's basically free wink.gif
  • FatAssasin
    Offline / Send Message
    FatAssasin polycounter lvl 18
    For anyone interested, there's an extremely informative DVD on the subject by maxScripting guru, Bobo (not the seal):

    http://www.cg-academy.net/pages/topic_ma...advanced_01.php

    I'm going through it now and highly recommend it.
Sign In or Register to comment.