lindylex

Members
  • Content Count

    16
  • Joined

  • Last visited

About lindylex

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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.
  2. 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
  3. [SOLVED SOLUTION] It took a while but here it is. http://www.babylonjs-playground.com/#1KN7ZA#2
  4. I got the text centered. How do I not have it not change the color of the background? I am confused by what changes the color. http://www.babylonjs-playground.com/#1KN7ZA#1
  5. I would like to solve two things. - How do I center the text on the front face of this mesh? - How do I only assign the text to the front face only? - How do I on click change the text? http://www.babylonjs-playground.com/#1KN7ZA Thanks
  6. Thanks so much. I see you change the color here. mat.diffuseColor = BABYLON.Color3.Blue(); How does it know to only change it to blue the back side? I assume this side. faceUV[0] = new BABYLON.Vector4(0, 0, 1, 1); Is it because the material is only visible on this face? And set to nothing on the other face in the for loop? for (var i=0; i < 6; i++){ faceUV = new BABYLON.Vector4(0,0,0,0); } I still do not understand why the color is not blue on all sides. Thanks
  7. This is my first playground. http://www.babylonjs-playground.com/#6BMU2#0
  8. Start by doing something like this? var texture = new BABYLON.Texture ("textures/concrete_cracked.png", scene); mat.diffuseTexture = texture; //Create faceUV var faceUV = new Array (6); //Apply the texture to the front of box faceUV[1] = new BABYLON.Vector4(0,0,6,6); I have an image file. I only need to apply it to the front face of the mesh. I am not sure about the numerical values for the Vector4(0,0,6,6); . Thanks
  9. I followed this tutorial. http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors I would like to change the color of the back face dynamically to the following. var faceColorsCorrect = new Array (6); faceColorsCorrect[0] = new BABYLON.Color4.FromHexString("#D40606FF"); //back faceColorsCorrect[1] = new BABYLON.Color4.FromHexString("#2C6744FF"); //front faceColorsCorrect[4] = new BABYLON.Color4.FromHexString("#95919DFF"); How do I do this after creating the mesh programmatically?
  10. Samuel, I can do it like this. new BABYLON.Color4.FromHexString("#FD6304FF"); Thanks for helping.
  11. How do I translate RGB color to new BABYLON.Color3(x, x, x) ? I would like this color R : 33 G : 87 B : 179 it is also represented as html value #2157B3 converted to BABYLON.Color3(x, x, x) ? Thanks