[Bf-committers] Another try for "Weight from Bone Glow"

Xavier Thomas xavier.thomas.1980 at gmail.com
Sun Nov 1 12:45:13 CET 2015


Here is my attempt at traducing the equation to pseudoce:

#DEFINE STEP_NUMBER 1000

for each bone:
    bl = bone.length
    bpos = bone.root_position
    section_length = bl / STEP_NUMBER
    bone_direction =
unitari_vector_pointing_in_the_same_direction_as_the_bone

    for each vertex:
        illum = 0

        for i=0 to STEP_NUMBER:
            vpos = vertex.position
            vn = vertex.normal
            bone_section_pos = bpos + (i * section_length) * bone_direction
            v2b = vpos - bone_section_pos

            if line from  vpos to bone_section_pos do not cross any face:
              illum = illum + (max(dot_product(v2b, vn), 0) /
power(length(v2b), 2)) * length(cross_product(v2b, bone_direction)) *
section_length

        illum =  bone_length * illum

normalise_weight()


2015-11-01 9:25 GMT-02:00 Xavier Thomas <xavier.thomas.1980 at gmail.com>:

> Do not mind the firts post, send automatically while writing
>
> 2015-11-01 9:24 GMT-02:00 Xavier Thomas <xavier.thomas.1980 at gmail.com>:
>
>> #DEFINE STEP_NUMBER 1000
>>
>> for each bone:
>>     bl = bone length
>> bpos =
>>
>>     for each vertex:
>>         illum = 0
>>
>>         for i=0 to STEP_NUMBER:
>>             bone_section_pos =
>>             illum +=
>>
>>                illum =  bone_length * illum
>>
>> 2015-10-31 12:36 GMT-02:00 Daniel Salazar - patazstudio.com <
>> zanqdo at gmail.com>:
>>
>>> Yes please someone! The bone heat approach feels lacking this days.
>>>
>>> Daniel Salazar
>>> patazstudio.com
>>>
>>>
>>> On Sat, Oct 31, 2015 at 8:15 AM, Gaia Clary
>>> <gaia.clary at machinimatrix.org> wrote:
>>> > hi.
>>> > Once in a while i visit this document  about "Weight from Bone Glow":
>>> >
>>> > http://www2.eng.cam.ac.uk/~rjw57/pdf/r_wareham_bone_glow_amdo_08.pdf
>>> >
>>> > I slowly make progress with understanding the mathematics here. I also
>>> > think that i have a "visual understanding" of how this works. However i
>>> > still struggle with translating equation (5) into a program.  Maybe
>>> > someone can find the time to translate this equation into some pseudo
>>> > code or so ?
>>> >
>>> > Then i maybe can translate this into an "Weight from Glow" Operator
>>> that
>>> > work besides the existing "weight from Bone Heat" Operator. Of course
>>> if
>>> > someone can do this in a snap, then i would not be sad if you just go
>>> > ahead and make a patch :)
>>> >
>>> > thanks for any feedback and help on this.
>>> > cheers,
>>> > Gaia
>>> > _______________________________________________
>>> > Bf-committers mailing list
>>> > Bf-committers at blender.org
>>> > http://lists.blender.org/mailman/listinfo/bf-committers
>>> _______________________________________________
>>> Bf-committers mailing list
>>> Bf-committers at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>
>>
>>
>


More information about the Bf-committers mailing list