George3D Posted March 3, 2017 Share Posted March 3, 2017 I have built a character with elements created by CreateSphere() and CreateCylinder(). All parented with a central element collected in an own function. To animate single limbs of the "android" I first used the function getChildMeshes() to get the children of the parent. The animation works together with a key-event, but there is one problem: while the first move the limbs are flying around, then they return to their place and work well. How can I solve my Problem? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 3, 2017 Share Posted March 3, 2017 Hello! it is tough to help you without a repro case Do you mind reproducing your issue in the PG? Quote Link to comment Share on other sites More sharing options...
George3D Posted March 3, 2017 Author Share Posted March 3, 2017 Ok, you'll find the (shortened) Code in the Playground: http://www.babylonjs-playground.com/#XVUEI#1 Quote Link to comment Share on other sites More sharing options...
gryff Posted March 3, 2017 Share Posted March 3, 2017 Well @George3D from your playground it looks like the cylinders that are your "limbs" are rotating about their origins - which are at the centre of the meshes. To rotate them properly, I think you need to move the origins (the pivot point) to the top of each cylinder. See this link for a discussion on doing this using "setPivotMatrix" http://www.html5gamedevs.com/topic/24800-manually-rotate-arcrotatecamera-around-target/?do=findComment&comment=141676 cheers, gryff George3D 1 Quote Link to comment Share on other sites More sharing options...
George3D Posted March 3, 2017 Author Share Posted March 3, 2017 Thank you griff for the hint to an interesting topic. But changing my code by using setPivotMatrix() doesn't solve the problem. the first step is still a "dancing" one. Quote Link to comment Share on other sites More sharing options...
adam Posted March 3, 2017 Share Posted March 3, 2017 http://www.babylonjs-playground.com/#LY90E#0 mesh1 is using setPivotPoint Quote Link to comment Share on other sites More sharing options...
George3D Posted March 10, 2017 Author Share Posted March 10, 2017 I want to repeat my "limb"-question: although the objects now rotate around an origin at the top of the cylinders, the first step they made a "jump". Does anyone know a solution for this Problem? http://www.babylonjs-playground.com/#XVUEI#3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.