Author Topic: Problems with bone position?  (Read 193 times)

Dennis Su   «   on: May 14, 2012, 05:44:38 AM »
Hi,

I want to build my project by Flare3D, but encounter some problems.

I placed two role on the scene, like this.

I found the left role will affect the right one.
When the left role plays any animation, the right one's fishing line will be affected.
Like this.







Dennis Su   «   Reply #1 on: May 14, 2012, 05:51:56 AM »
I'm sorry, the post is not finished.

If I remove the left one, the line will be normal.
Like this

I use the function to find the bone position.
// added on ExitDraw Event
protected function updateCastingRodIdleLine(e:Event):void{
    var mesh:Mesh3D = e.target as Mesh3D;
         
    fishingLine.clear();
    fishingLine.lineStyle(1, 0xffffff);
         
    // from 
    var from:Vector3D = getTargetPosition(mesh, "r-12");
    fishingLine.moveTo(from.x, from.y, from.z);

        // to
        ..........
}

protected function getTargetPosition(skinnedMesh:Mesh3D, boneName:String):Vector3D{
    var skin:SkinModifier = skinnedMesh.modifier as SkinModifier;
    var bone:Pivot3D = skin.root.getChildByName( boneName );
         
    var matrix:Matrix3D = new Matrix3D();
    matrix.copyFrom( bone.global );
    matrix.append( skinnedMesh.global );
    return matrix.position;
}
Did I do something wrong?
Thank you.


Dennis Su   «   Reply #2 on: May 14, 2012, 06:06:49 AM »
My code is shown below:
PlayerRoleController entedns BaseRoleController.

The left role is a instance of BaseRoleController, the right on is PlayerRoleController.
I use the function updateFishingLineState() (in 
PlayerRoleController ) to update the line.

I do not know how this problem occurred....
Thank you.

Ivan Vodopiviz   «   Reply #3 on: May 15, 2012, 03:24:56 PM »
Hi,

That's... a lot of code to look at. The basic code looks fine (isn't it the same we sent you some time ago?), but I'm afraid that just looking at code I won't be able to find the issue.

Could you send us a working demo with source to info AT flare3d.com?

Cheers,

Dennis Su   «   Reply #4 on: May 16, 2012, 03:27:03 AM »
Hi,

I will send you the demo project to show this case.

Thanks a lot.

Jason Huang   «   Reply #5 on: May 17, 2012, 01:16:43 PM »
I have the same problem. it seems like we cloned those objects which contain bones. I guess the bone did not clone as we do to the mesh, so all of them sharing same bones. which means we change animate one object the others would be animating also.

Dennis Su   «   Reply #6 on: May 28, 2012, 07:45:16 AM »
Hi,

Did you get my mail?
Any idea with this problem?

Thank you.

Ivan Vodopiviz   «   Reply #7 on: May 28, 2012, 02:33:25 PM »
Yes, we received it, sorry for the delay.

Unfortunately, we weren't able to find the root of the issue. If I recall correctly, we sent you a smaller demo with this feature working, but the last code you sent us is much bigger and complex. Did that demo work for you? Were you able to merge it with your current code?

Dennis Su   «   Reply #8 on: May 29, 2012, 06:42:34 AM »
Hi,

Last demo you sent works fine.
I already merge it into my code.

Dennis Su   «   Reply #9 on: May 29, 2012, 06:50:02 AM »
Oh!

I find the problem, here is my demo.
If I add a second camera, the line will be crazy.

Thank you.