Jump to content

Text Orientation On Back Of Box


lindylex
 Share

Recommended Posts

		var animateRotation = function (theBoxToRotate) {
			//alert (theBoxToRotate.rotationQuaternion);
			
			var rotationQuaternion = BABYLON.Quaternion.RotationAxis (BABYLON.Axis.Y, Math.PI);
			var end = theBoxToRotate.rotationQuaternion.multiply(rotationQuaternion);
			var start = theBoxToRotate.rotationQuaternion;

			//Create the animation object
			var animateEnding = new BABYLON.Animation(
			"moveY",
			"rotationQuaternion",
			30,
			BABYLON.Animation.ANIMATIONTYPE_QUATERNION,
			BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE);

			//Animations Keys
			var keys = [];
			keys.push({
				frame:0,
				value: start		
			},{
				frame:30,
				value: end
			});
			
			//Add these keys to the animation
			animateEnding.setKeys(keys);

			// Link the animation to the mesh
			theBoxToRotate.animations.push(animateEnding);

			// Run the animation
			scene.beginAnimation(theBoxToRotate, 0, 30, false, 1);


		}; 

This is how I rotate the box.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...