Search the Community
Showing results for tags 'mesh collision'.
-
Hi, Here is my example. Code works so that perplexus(mesh) is rotated around it's center. With Key 1,2 around Y, with key 3,4 around X and key 5,6 aroudn Z. Can anybody help me to solve how to rotate perplexus(mesh) around current center of payBall(mesh)? http://86.58.118.110:8080/BabylonBall/Main.html if I add code var currentCenterPlayBall = perplexusRef.playBall.getBoundingInfo().boundingSphere.center; I get currentCenterPlayBall (x,y,z). How can I rotate perplexus Mesh around currentCenterPlayBall this current (x,y,z) ? switch (keycode) { // user inputs case 49: // 1 perplexusRef.perplexus.rotate(BABYLON.Axis.Y, Math.PI / +512, BABYLON.Space.LOCAL); perplexusRef.perplexus.updatePhysicsBodyPosition(); brake; case 50 : // 2 perplexusRef.perplexus.rotate(BABYLON.Axis.Y, Math.PI / -512, BABYLON.Space.LOCAL); perplexusRef.perplexus.updatePhysicsBodyPosition(); break; case 51 : // 3 perplexusRef.perplexus.rotate(BABYLON.Axis.X, Math.PI / +512, BABYLON.Space.LOCAL); perplexusRef.perplexus.updatePhysicsBodyPosition(); break; case 52 : // 4 perplexusRef.perplexus.rotate(BABYLON.Axis.X, Math.PI / -512, BABYLON.Space.LOCAL); perplexusRef.perplexus.updatePhysicsBodyPosition(); break; case 53 : // 5 perplexusRef.perplexus.rotate(BABYLON.Axis.Z, Math.PI / +512, BABYLON.Space.LOCAL); perplexusRef.perplexus.updatePhysicsBodyPosition(); break; case 54 : // 6 perplexusRef.perplexus.rotate(BABYLON.Axis.Z, Math.PI / -512, BABYLON.Space.LOCAL); perplexusRef.perplexus.updatePhysicsBodyPosition() break; Any help? greetings Any help? greetings