• Content Count

  • Joined

  • Last visited

About DigitalHilsone

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Location
    Ivanovo, Russian Federation
  1. I'll tell you the essence - have a car, and I did not get her to learn to ride the stage for arrow keys. That is, the forward arrow - gas back - brake well, and left \ right the associative Could you help with the implementation of this task?
  2. Guys, please help to deal with the movement of the model (car). I wrote some code, but it is not working. Point me in the right direction. var Control = (function () { function Control() { this.c = 0; } Control.prototype.keyUp = function (key) { switch (key) { case 39: Control.moveLeft = false; break; case 38: Control.moveForward = false; break; case 37: Control.moveRight = false; break; case 40: Control.moveBackward = false; break; } }; Control.prototype.keyDown = function (key) { switch (key) { case 39: Control.moveLeft = true; break; case 38: Control.moveForward = true; break; case 37: Control.moveRight = true; break; case 40: Control.moveBackward = true; break; case 68: if (this.c % 2 == 0) { Control.driftMode = true; } else { Control.driftMode = false; } this.c++; break; } }; Control.moveForward = false; Control.moveBackward = false; Control.moveLeft = false; Control.moveRight = false; Control.driftMode = false; return Control;})();
  3. Please tell me how to implement the speedometer? It can be in any unit of measurement - kilometers or miles. And yet - how to open a window with the text when you move the sphere (I use them as planets), I would like to hover cursore a window with description.
  4. Hello) Prompt two things, please: 1. How to add to the scene two .babylon model to one was the surface, and the second can be controlled and moved over the surface? 2. How can we realize switching model? In other words, how to implement the switching from the first vessel to the second. Thanks in advance)
  5. Of course) in September already all I tell and show what this project and that it will be. ps .: there is an opportunity I would like to ask for more help to cope with a bit unrealistic path of rotation of the ship - imagine so cruiser say will unfold)
  6. @iiceman, thank you very much. Everything works)
  7. When an unidentified specific sequence somehow the ship suddenly starts to climb up, but it should not be. The bug occurs when you click on the left side of the scene. Tell me, please, what is it? Link to the project. var clientX = 0; var clientY = 0; window.addEventListener("mousedown", function (e) { if ( == 'renderCanvas') { clientX = e.clientX; clientY = e.clientY; } }); window.addEventListener("mouseup", function (e) { if ( == 'renderCanvas' && Math.abs(clientX - e.clientX) < 10 && Math.abs(clientY - e.clientY) < 10) { var pickResult = scene.pick(scene.pointerX, scene.pointerY); if (pickResult.pickedPoint) { facePoint(newMeshes[0], pickResult.pickedPoint, scene, function () { moveObjectToPoint(newMeshes[0], pickResult.pickedPoint, scene); }); } } }); function facePoint(rotatingObject, pointToRotateTo, scene, callback) { var direction = pointToRotateTo.subtract(rotatingObject.position); var v1 = new BABYLON.Vector3(0,0,1); var v2 = direction; var angle = Math.acos(BABYLON.Vector3.Dot(v1, v2.normalize())); console.log(angle); if (direction.x < 0) angle = angle * -1; var rotationAnimation = new BABYLON.Animation("rotationAnimation", "rotation.y", 10, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); var keys = [ { frame: 0, value: rotatingObject.rotation.y }, { frame: 10, value: angle } ]; rotationAnimation.setKeys(keys); rotatingObject.animations.push(rotationAnimation); scene.beginDirectAnimation(rotatingObject, [rotationAnimation], 0, 10, false, 1, function () { if (callback) { callback(); } }); } function moveObjectToPoint(objectToMove, pointToMoveTo, scene) { var moveAnimation = new BABYLON.Animation("moveAnimation", "position", 10, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); var keys = [ { frame: 0, value: objectToMove.position }, { frame: 30, value: pointToMoveTo } ]; moveAnimation.setKeys(keys); objectToMove.animations.push(moveAnimation); scene.beginDirectAnimation(objectToMove, [moveAnimation], 0, 30, false, 1); } });
  8. With the first days of July! Please tell me the answers to a couple of things: 1. How to make so that when you double-click on any player object transferred from one stage to the stage 2? In other words - how to do that at an event on the gaming facility dblclick a change of scene. 2. How to do that when you click the player's character was directed to the object (the gate) and in their achievement of a change of scene (location).
  9. My mistake, is now explained. For example, the ship we click in the right pane -> right the ship is flying -> camera turns slightly to the left (ie, in the opposite direction).
  10. Hello. Tell me, gentlemen, please, how you can make the camera so that it is sensitive to rotate relative to the flight of the ship, as in the screenshot. For example, the ship we click in the right pane -> right the ship is flying -> camera turns slightly to the left (ie, in the opposite direction). Second. I know this topic I had been the occupying this forum, but I would have to finish all) So, please see the fact that I have now and tell me how to make a more realistic management. As an example, I cite the video. In the video if there is no first point - turn the ship relative to the part of the flight
  11. Guys, there's the option of use. The problem is well known: it is necessary to make the "ship to" move "the nose" (before), but not the center of the figure. This can be done by means of Babylon? upd: very informative!
  12. Greetings to all.I go straight to the point - I can not make the turn the ship according to the direction of flight. There is a lack of experience and knowledge. Please help.I laid out a project on their own domain and put the source code. Thanks in advance. And finally the question - who can help with the project by writing tips? Also, I can tell you about all those interested in the project through private messages.
  13. Thank you to everyone who responded to the rescue! Thank you for your work! As I understand it, to organize proper management - you need to draw a flight path of the ship and doing certain conditions? Otherwise, such as make a loop? The ship also will rotate around itself for a given program. There has probably not save any algorithms, right?
  14. Here, I was able to make a rotation method of travel. But it uses a mathematical formula for calculating the angle of rotation of the click coordinates (Formula slope - K=(y2-y1)/(x2-x1) ). But the rotation got pretty bad. That is not in the right direction turns, not on the corner. Help with this challenge. I need to get the front of the spacecraft (the model in my project) was moved to this part of the front, not the side or something else.