lindylex Posted August 3, 2016 Share Posted August 3, 2016 I have a box I have written a number to using drawText. When the box is clicked it turns around on the y axis. How can I fix the orientation of the text so it is not upside down when it turns around? Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 4, 2016 Share Posted August 4, 2016 How do you rotate the text? Are you using a DynamicTexture? Quote Link to comment Share on other sites More sharing options...
lindylex Posted August 5, 2016 Author Share Posted August 5, 2016 Yes I am using DynamicTexture. Quote Link to comment Share on other sites More sharing options...
lindylex Posted August 5, 2016 Author Share Posted August 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 5, 2016 Share Posted August 5, 2016 you do always dynamicTexture then a dot i get different options in the playground dynamicTexture.wAng -= 0.03; will rotate dynamictexure clockwise as example and then i sitting for hours experimenting Quote Link to comment Share on other sites More sharing options...
lindylex Posted August 9, 2016 Author Share Posted August 9, 2016 On 8/5/2016 at 0:30 PM, Nabroski said: dynamicTexture.wAng -= 0.03; will rotate dynamictexure clockwise as example Where are you assigning this value? Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 9, 2016 Share Posted August 9, 2016 somewhere where the value is constantly updated ?http://doc.babylonjs.com/playground @lindylexhttp://babylonjs-playground.com/#1I5MDT#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.