Search Unity

Are bones actually elongated, or is that just a visual aid

Discussion in 'General Discussion' started by T0rp3d0, Mar 20, 2020.

  1. T0rp3d0

    T0rp3d0

    Joined:
    Feb 4, 2018
    Posts:
    31
    Hello everyone,

    Many 3d animation programs show bones as elongated "objects". Such that when you rotate the bone, it seems to pivot around some point. I recently started working on some active ragdoll stuff, and am now manually setting up colliders among the bones for that. Of course, i could set up a separate hierarchy of colliders on an entirely different game object for the ragdoll, but I would like to try something different instead. I've reached the point where i have to decide whether to move and/or scale the colliders, so that they "match" with each other, leaving no gaps between them. But since the colliders are in exactly the same position as the bones they will reference rotations from, i'm hesitant whether moving the colliders is a wise decision. I can make my conclusion once someone can confirm whether "bones" are just uniformly scaled (x:1, y:1, z:1) structures, or if they are actually scaled as depicted in Blender, Maya, UMotion, etc.

    Thank you for your time.
     
    Last edited: Mar 20, 2020
  2. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    The elongated shape of bones is used during the skinning authoring process, but other than that it's just visual aid. A bone in unity is just a point in space, vertices bound to it (skinning) and a placement in hierarchy.

    You're aware there's a ragdoll wizard in Unity that will automatically set up colliders and constraints?
     
  3. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    5,181
    Already answered but I'll say same thing in different way :

    Yes bone is only visual aid. There is not actually a bone, only the joints. And a joint is really just a way of organizing things. Rather than moving many vertices, we assign many vertices to a single joint (weighting), and move the joint instead. But at the bottom level these are all just points in 3d space.

    The bones represent the hierarchy the joints are in. Elbow bone connects to the shoulder bone, shoulder bone connects to the... you know the rest.
     
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,569
    A bone is a visual aid.

    A bone is a point. With translation+rotation+scale matrix associated with it. TO make it easier work with, it is visualized as a stick.

    I think moving colliders might not be a good idea, as when collider does not have a rigidbody associated with it, the game consideres it to be a static collider, and updating it is slower.

    Some games, however, support "stretch hierarchy nodes" where a bone can stretch without scale propagating to children. In this case bone is a stick, but even in this case it only uses its original length to calculate stretch factor.
     
    T0rp3d0 likes this.
  5. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    One time that the bone's visuals could matter(in Blender for example) is with automated vertex weights. There is a feature that uses "envelopes" which have sizes based on the visual size of the bones(which is based on dragging the tail around). Then the envelopes check which vertices are inside them and adds the weights accordingly in a nice automatic manner. This is a nice way to get vertex weights done faster. It often needs some tweaking afterwards to get it perfect but supplies a good starting point.
     
    T0rp3d0 likes this.
  6. T0rp3d0

    T0rp3d0

    Joined:
    Feb 4, 2018
    Posts:
    31
    Great, i know now what to do.