• Content Count

  • Joined

  • Last visited

1 Follower

About digEmAll

  • Rank

Profile Information

  • Gender
  • Location

Recent Profile Visitors

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

  1. Hi All, the issue I'm facing is probably trivial to solve but I couldn't find a solution. Basically I need to set the parent of a mesh (used as rotation pivot) to null after a rotation, because I need to use that pivot again for another group of meshes. I tried to use the following approach: var pos = box.getAbsolutePosition(); var rot = box.rotation; box.parent = null; box.setAbsolutePosition(pos); box.rotation = rot; but it seem to keep only the position, but not the rotation. I have created a simple playground to reproduce the problem : https://www.babylonjs-playground.com/#S13YXG#2 As you can see, when the animation is completed the bigger box returns to the original rotation. Any suggestion ? Thanks a lot in advance
  2. Any news on this topic ?
  3. I found a workaround, look at the new jsfiddle : https://jsfiddle.net/7042d86p/6/ Don't know if it might be considered a bug, anyway, with those three lines it works.
  4. Hi All, I'm starting to play with PIXI (after some tests on phaser) so apologies for the newbie question... I can't figure out why creating a game with window.innerWidth and window.innerHeight doesn't work correctly in PIXI (i.e. the scrollbars appear) while it works perfectly fine on Phaser. I reproduced the problem in two really simple jsfiddle (just a blue HTML5 canvas on a red background body that I expect to be completely covered), as you can see in the PIXI example the scrollbars appear while in the Phaser example they don't : PIXI v3 : https://jsfiddle.net/7042d86p/5/ Phaser v2: https://jsfiddle.net/o6ghgckb/2/ Any idea ? Thanks in advance
  5. This works because rotations are by 180°, if you change it to 90° the problem remains Thanks, I used your suggestion to use quaternion and I copied the necessary code bit from Mesh.rotate, obtaining this (the desired behavior) : http://babylonjs-playground.com/#NJJPP#7 Thanks to all
  6. That's great! But... is it possible to use it in animations ?
  7. Hi All, I'm facing a problem with rotations of boxes. Basically I need to rotate a cube by 90° around the system axes, but I noticed that when a box has a rotation set, say on x axis, if you set a rotation on z, actually you're rotating the mesh around the global system Y axis. Does rotation property refer to a coordinate system that is "local" to the mesh ? How can I calculate the correct x,y,z rotation with respect to the global axes ? Thanks in advance P.S. I have created a simple playground for this: http://babylonjs-playground.com/#NJJPP#0 If you click once on "rotat.around x" then when you click "rotat.around.z" (more than one time to notice the rotation) you will get a rotation around global Y axis. But if you only click on the same button multiple times (refreshing the page to reinitialize when you decide to change the button) the rotations are performed around the right axis.
  8. Thanks, for the research Actually these "rotations" might happen also programmatically, so it's easier to reach a greater number than user-clicked only, anyway I don't think I would never reach 100 times. Thanks to all for the help !
  9. Thanks iiceman for your solutions, but I don't want to disable the button because user should be able to create a "chain" of rotations, and I can't use the first solution as well because that means the second (or third, forth.. ) rotation will start before the end of the previous. Probably I oversimplified my example, but basically in the real case, box can rotate by 90° in different directions (around x, y or z) and different rotations cannot be "combined", but only "chained". My quick'n'dirty solution is to use an array as rotations queue, as shown here : http://babylonjs-playground.com/#1NSSHK#3 but I'm not expert enough in javascript to be sure this approach is safe. For example, is there a risk for a stack overflow due to the recursion? Are the operations "atomic" enough such that I'm sure that nothing can happen between the status boolean change and the status boolean check ? Thanks again
  10. Hi All, I am new to this forum so I hope I didn't break any rule writing my question here... My problem is probably trivial but I'm not sure how to implement it correctly. Basically I have a project where users can trigger some 90° box rotations (implemented as animations) by clicking on a button. Rotations work as expected, but problems arise when user clicks multiple times before previous rotations have completed. In this case, obviously, the following rotations start while the box is in the middle of previous movements therefore the final position of the box is not a multiple of 90° with respect to the initial position. I made a playground example to reproduce the problem: http://babylonjs-playground.com/#1NSSHK#0 I think I should use the callback function of the rotation, but I'm not sure how (I'm pretty new to javascript...) Thanks in advance