Jump to content

Search the Community

Showing results for tags 'rotation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





  1. Hey all! I am both new to Babylon and these forums! I want to make a First Person Camera that moves in a direction based on its rotation (e.i. like a forward/backwards functionality with W/S). Only problem is I don't know how to do this without maybe physics engines enabled or making a bunch of really janky movements. I want something like Unity's Transform.forward. How do I achieve this?
  2. Hi everyone! I used the json and atlas file for using spine in pixi.js But the rotated pieces of image are not converted to correctly. So i wanna rotate some pieces in the programming Thanks.
  3. Hello there! I'm working with this example (asteroids movement): LINK There is a strange behaviour that blows my brain out. It can be better seen on the attached video. All I've done was a small rotation and then just pressed UP cursor key. As you can see with the help of turned on debugger velocity vector rotates during fly until it reaches bottom-right corner of the bounding box. Also it force ship to fly wrong, it can be noticed even without debugger. Expected that velocity vector to be applied directly to where ship's nose is (or more correctly, ship have to move to the oppos
  4. Hello everybody, I am new to Phaser and thought why not start with Phaser 3. My program dynamically changes the rotation of a box and I wanted the collider to rotate as well, but I didn't find how to archive this. var config = { type: Phaser.AUTO, width: 800, height: 600, //window.innerHeight; physics: { default: 'arcade', arcade: { gravity: { y: 300 }, debug: true } }, scene: { preload: preload, create: create, update: update } }; //... function create() { //... blockAU =
  5. Guys, I need help. How to turn the mesh towards the point given by the vector? What method of rotation is needed here? Rotations is my weakness..
  6. Hello, I am trying to imitate a rotating part (a.k.a. "windmill" please see this youtube video) using the Matter physics engine's constraint. I have tested a body shape made with PhysicsEditor and that of simple image shape (just a thin rectangle). The windmill made with PhysicsEditor keeps on rotating and it does not seem to stop until you give another collision to the body. Here is a codepen to demonstrate. https://codepen.io/BeFiveINFO/pen/EdQgdq Please try pressing space key for a second. Is there any way to control the behaviour of the body shape made with Physics
  7. I'm totally stumped here. Why is one mesh spinning like crazy but the other standing still? Playground: https://playground.babylonjs.com/#6FB40P
  8. Hello everybody! Hope everyone is going well in the Babylon community ! My issue is simple : I use the mesh.rotate() function in order to rotate a mesh in the BABYLON.Space.WORLD. The function works great and my mesh rotate exactly how I want. The mesh.rotate() function use quaternion and so the rotation attribute is set to Vector0. But when the rotation is hover I would like to have the euler rotation back! To do so I use the mesh.rotationQuaternion.toEulerAngles() function But if I set the mesh.rotation = mesh.rotationQuaternion.toEulerAngles(); Then the mesh is rotati
  9. I'd like to use sprites with 3D look (using light sources which cast shadows), and pre-render them from 3D models to 2D images for sprites. For sprite rotations (think Asteroids ship rotating), I thought I'd pre-render multiple frames for the different rotation angles, and select the frame which matches the rotation angle. I cannot figure out how to best handle this in Phaser Arcade Physics. If I try to use body.angularvelocity which seems to set sprite.rotation, the framework rotates the currently active frame, which messes up the shadow directions. Is there some way to ov
  10. Simple: I need the Rotation Matrix from the default Arcrotate Camera. I read somewhere in the forum, i need to decompose the Camera Matrix, i can' t find it anymore. Subquestion: It is possible to grab the data via mouseevents ? Thanks' Playground: https://www.babylonjs-playground.com/#SQP9E0
  11. When I create a hexagonal prism for SPS, it does not seem to recognize the rotation. I have been rotating the particles en masse after creation, but I gotta believe I am just doing it wrong. https://www.babylonjs-playground.com/#YI6D05#2 The "shapes" have no color. The particles are colored. To save memory, I must have "updatable" set to false. This makes my work-around harder. Advice requested.
  12. Hey everyone I'm back! I have a mesh that rotates around the Y axis whenever I click and drag along the screen: var currRotationY = 0, currPositionX = 0, clicked = false, originalRotation; canvas.addEventListener("pointerdown", function(evt) { currPositionX = evt.clientX; currRotationY = player.mesh.rotation.y; originalRotation = player.axis.rads; clicked = true; }); canvas.addEventListener("pointermove", function(evt) { if (!clicked) return; //player.mesh is my mesh player.mesh.rotation.y = currRotationY + (evt.clientX - currPositionX) / 500.0; }); canvas.addEventListener("p
  13. I think I may be using rotation incorrectly, but I'm not sure what I'm doing wrong. I'd ask a more specific question, but I truly have no idea how to narrow things down. So either I have a small stupid bug somewhere (could be...) or just a fundamental misunderstanding of something 3D, in which case I hope someone in this forum can point it out. I've got a multiplayer first person shooter where the game client sends its keystrokes and camera rotation to the server. This is used to rotate the player's mesh (which is just a cube with a red face for forward) and then move the player around. T
  14. Hello there. 🙂 I have a sprite which rotates. And i have a healthbar added to that sprite as a child. My problem is: The healthbar does what children are supposed to do! But i don't want that! 😅 How to keep child sprites from rotating with their parent? I want it to always stay at the same position relative to the parents anchor. I'm not talking about fixing its angle - that can be done by simply setting it to the negative angle of its parent each time it rotates (at least i don't know any other way). I'm talking about its position. Is there a fixedToCamera equivalent
  15. Hi, I'm having some trouble with my emitter that is used as spray particles for a fire extinguisher. I've set the emitX and emitY to position relative to the player's front arm and set the emitter.rotation = frontArm.rotation. The problem I'm having is that when the arm rotates the particle's emit location is moved. I've attached some screenshots and code to show what I mean. I'm sure it is something simple that I'm missing but I've searched on the forums for quite a while and can't seem to find a solution. Any help would be appreciated. FireSim.test = { create: function() {
  16. Hello evryone Sorry in advance for my bad english; I wanna ask somthing about .ArcRotateCamera (); I want to make camera with locked position behind the player when the player moving but if player stand on the place he can moving around with the camera and when he again start moving the camera smoothly rotating to the locked position. I wondered if I will make somehow the camera will checking position.z of the player then camera will be calculate position behind the player. Here is my player how move in game for better understending: http://www.babylonjs-playground
  17. I know I can't stop gimbal lock but I'd like to avoid the circumstances where it occurs in my application i.e. when a lookAt() call returns a vector close to the zenith. Basically I'd like to clamp the rotational pitch from 0 to 85 degrees, rather than allowing it to ever reach 90 degrees. I see the lookAt method has an optional parameter for pitchCor (pitch correction) but that doesn't seem to do what I want. What I'm thinking at the moment is I need to test the lookAt result to see of it's >= 85 degrees pitch and if so then clamp the pitch back to 85 degrees (without altering ya
  18. Hello guys, I use the UniversalCamera in my project. On my mobile device it works really well and does what I want it to do, except for the left and right rotation. When I wipe up and down, the camera moves much faster than left and right. I have already tried the camera. angularSensibility, but it has no visible effect. for example, if I use the Gyro camera and press on the screen, I can control the camera very well and would like to have such a behaviour with the UniversalCamera. Did I miss something or is there a value I need to adjust? I would like to double the speed of mobi
  19. I have a "Gun" object and a "Bullet" object, and I'm trying to adjust the offset at which the bullet should start from the gun, but I'm getting an unexpected margin which I can't find where it's getting from. This extra margin/distance happens when I fire the gun to the right or down, but it converts into a negative margin/distance when I shoot to the left or up. The second problem is that the text "pium pium" get's horizontally/vertically out of it's body depending of the angle. Here is a demo of the problem: http://plnkr.co/edit/dOLK0j1qOEphv2nLLJKE?p=preview
  20. Hi, there. How to make a FreeCamera rotate only by Alpha rotation? Only longitudinal? I want to turn off a Beta rotation (up and down rotation of camera). Thanks.
  21. Hi, I am trying to rotate a mesh with a custom pivot, using setPivotMatrix function. In the sample below, the pivot (red box) "seems" to be in the right position, but the rotation done is not as expected (green and grey box should be superposed on the corner). I dont understand the setPivotMatrix http://www.babylonjs-playground.com/#4FNAXM#2 Why the pivot point (red box) is not inside the green box in this sample ? I just would like something like : X X [X] X X X Where [x] is the superposed part of the 2 meshes. Thanks
  22. Hey guys, I got a question about the WebVrFreeCamera. How can I animate the rotation of a WebVrFreeCam? I would like to click on a button to direct the users gaze to something important. Hence the animation. THANK YOU FOR ANY TIP there is a code snippet: https://playground.babylonjs.com/#UXXVST
  23. Does anyone know how to rotate a sprite from it's current rotation? I'm having a Math brain fart. Here is my Sandbox example of the issue: http://phaser.io/sandbox/HhWNhhmR/play The sprite rotates around it's center when you drag it, but it always snaps to the mouse. How can we rotate it from where it currently is? I would love to have it respond in a similar way that PropellerJS works. As a bonus, it would be awesome to add the inertia and stepped angle constraints. Thanks!
  24. I have a sprite and a body that both rotate towards the pointer. On collision, though, the sprite sometimes gets turned away from the body. The body continues to point towards the mouse but the sprite does not (see image, definitely not the worst that it can be). I haven't found a way to fix this, anyone know how?
  25. Hi, I've experienced weird problem when I try to rotate an imported gltf mesh. It turns super fast and seems not logic at all. Someone has any idea why? Or is it a bug? Here is the playground example to show this problem. Thank you. http://www.babylonjs-playground.com/#742772#3
  • Create New...