Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Last active August 5, 2018 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/3ebf967ceecca7b00620e888c17ec46f to your computer and use it in GitHub Desktop.
Save flushpot1125/3ebf967ceecca7b00620e888c17ec46f to your computer and use it in GitHub Desktop.
//translateを実現
var direction = new BABYLON.Vector3(0, 3, 0);//目的地
direction.normalize();
distance = 0.01;
var i = 0;
scene.registerAfterRender(function () {
if(pushedFlag == true){
if(i++<300){
mesh.translate(direction, distance, BABYLON.Space.WORLD);
} else{
translateFlag = false;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment