swat0284 Posted October 16, 2016 Share Posted October 16, 2016 Hello, when i want to rotate my mesh by using animations it gone, i can get object, see it position but mesh is gone checkpointsPositions re objects so they have got quarention HERE - i add "rotation" "QUATERNION" just everything connected with rotation function CreateAnimation(index = 0) { var rotationAnimation = new BABYLON.Animation("rotationAnimation", "HERE", 30, BABYLON.Animation.ANIMATIONTYPE_QUATERNION, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var rotationKeys = []; var rotationLenght = 0; for(var i = 0 ; i < checkpointsPositions[index].length-1 ; i++) { rotationKeys.push({ frame: i*60, value: (checkpointsPositions[index][i].rotation) }); rotationLenght++; } rotationAnimation.setKeys(rotationKeys); var bezierEase = new BABYLON.BezierCurveEase(0,0,0,0); rotationAnimation.setEasingFunction(bezierEase); players[index].animations.push(rotationAnimation); scene.beginAnimation(players[index], 0, rotationLenght*60, true); } Quote Link to comment Share on other sites More sharing options...
JohnK Posted October 16, 2016 Share Posted October 16, 2016 In a PG create a simple box apply your animation function and see if it works. If not give a link to it and you will find people who will want to help. Quote Link to comment Share on other sites More sharing options...
swat0284 Posted October 16, 2016 Author Share Posted October 16, 2016 http://www.babylonjs-playground.com/#O3RBC#5 sample, rotation doesnt work and i dont know why Quote Link to comment Share on other sites More sharing options...
adam Posted October 16, 2016 Share Posted October 16, 2016 http://www.babylonjs-playground.com/#O3RBC#11 swat0284 and brianzinn 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 17, 2016 Share Posted October 17, 2016 Adam is the god of PG Quote Link to comment Share on other sites More sharing options...
adam Posted October 17, 2016 Share Posted October 17, 2016 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.