• Content count

  • Joined

  • Last visited

  • Days Won


max123 last won the day on November 7 2017

max123 had the most liked content!

About max123

  • Rank
    Advanced Member

Profile Information

  • Location
    London, UK

Recent Profile Visitors

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

  1. max123

    Make gameplay smoother

    I presume @syed samoon is talking about game loop delta timing. Generally speaking, game loops, in their simplest form, work similar to: const _fps = 60.0; const _interval = 1000.0 / _fps; const _lastTick =; private tick() { let now =; requestAnimationFrame(tick); let frameTime = now - _lastTick; _lastTick = now; update(frameTime); } Where frametime/deltatime is the time spent within one tick. You can go all fancy and and split update/render methods and run update() inside a while loop : _delta += frameTime; while (_delta >= _interval) { _delta -= _interval; update(1); } Which will give you constant update (could be important for game state/physics) and render-whenever-you-can setup. But as other users have pointed out, you can use Babylon's engine.getDeltaTime()
  2. max123

    Aliasing in VR mode

    Same thing happens with VRDeviceOrientationFreeCamera, when compensateDistortion is set to true: antialiasing is just gone.
  3. max123

    Fire Particles

    Tweaked smoked a bit so it looks more like kids shouldn't play with matches:
  4. max123

    Three.js or Babylon.js for room design

    You guys rock! @Temechon, I'll give it a go
  5. max123

    Three.js or Babylon.js for room design

    hahaha you beat me to it, @Deltakosh!
  6. max123

    Three.js or Babylon.js for room design

    As I said, I don't disagree with decisions made - It's just we all have our own view of what's best
  7. max123

    Three.js or Babylon.js for room design

    Well, a pickInfo object is a necessary evil: you do need to return the result of picking
  8. max123

    Three.js or Babylon.js for room design

    When you call public pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo { return this._internalPick(world => { if (!this._pickWithRayInverseMatrix) { this._pickWithRayInverseMatrix = Matrix.Identity(); } world.invertToRef(this._pickWithRayInverseMatrix); return Ray.Transform(ray, this._pickWithRayInverseMatrix); }, predicate, fastCheck); } Ray.Transform returns new Ray.
  9. max123

    Three.js or Babylon.js for room design

    Bad phrasing on my part. I didn't mean that by default the engine itself creates/destroys thousands of objects; it's the use cases where a user has to do loads of ray picking for example.
  10. max123

    Three.js or Babylon.js for room design

    Hi @RaananW, CSS: Inside freeCamera and arcRotateCamera classes: element.tabIndex = 1; Inside babylon.scene: canvas.tabIndex = 1; Inside VirtualJoystick: = "5"; And yeah, you're right about the debug layer: when the new one came out, I just gave up on it: no matter what, it wouldn't play nice with my app Cameras: I think I covered the subject some time ago, but for me the whole idea of having loads of different camera classes with their own controls feels clunky: I think that having a camera and separate controls would be easier to reason with, e.g. a Camera class would only have properties you normally associate with a camera: fov, min/maxZ, mode (perspective/ortho). Then you would have SEPARATE camera rig classes: Free/FPS, Orbit, Joystic, etc. Again, it's just my opinion Objects creation/destruction: While playing with Rays (I know, it's dangerous!), I noticed that when you pickWithRay, it would then return Ray.Transform, which calls var result = new Ray(new Vector3(0,0,0), new Vector3(0,0,0)); Ray.TransformToRef(ray, matrix, result); return result; There were other places where I noticed "new" keyword (I'll have to dig through my older code).
  11. max123

    Three.js or Babylon.js for room design

    As many here, I moved from Three to Babylon. My reasons: - Three feels neglected at the moment. It was hard to get things fixed. I had an issue with Blender exporter, it took Three community 6-7 months to resolve the bug. When it comes to Babylon, things get fixed PRONTO. I mean often within hours! - This neglect translates to maintainers of various Three importers/exporters, e.g. Collada seemed to have been broken for ages. - It's easier to get help for Babylon. This community is fantastic! - A lot of building blocks are already present in Babylon: drag/drop, scene optimisers, render loop with delta time, etc.. Pros/Cons of both: - Three feels more coherent at times. When you get past the learning curve, everything (well, almost) seems to follow a set logic. I can't say the same thing about Babylon (the whole Cameras approach feels clunky). - Babylon is too "object orientated" for its own good It's a good thing, generally, but I feel that sometimes levels of abstraction can get too high and long-winded. For example, I got lost at custom shaders bit. Besides, OO is NOT always the best approach where performance is important and the engine is creating/destroying thousands of objects at every tick. - I don't like Babylon's presumption that it knows best what to do with CSS. It's quite a big one for me and with every release I have to go to source code and remove all CSS-related stuff: z-index, tab order, etc. as it messes up with styles already present. Overall, I think Babylon is more modern, has more features and is FAR easier to get going than Three. If I had to compare these frameworks to programming languages, I'd say Babylon is C# and Three is an early version of C++
  12. max123

    How to camera go upstairs !

    I used a ramp.
  13. max123

    How to camera go upstairs !

    I've made something like this and it's working fine for my needs. Here are the steps I took (do you geddit? steps?): 1. - Create model in Blender. - Define simple meshes in Blender for collisions (mostly Planes). So for your staircase you'll use a rotated plane. - Give a certain prefix to those Planes, e.g. "collider_". - Export .babylon. 2. Loop through the meshes and apply required properties to all meshes with prefix "_collider": public static setCollisionsByPrefix(prefix: string, scene: any): void { for (let i = 0; i < scene.meshes.length; i++) { let mesh = scene.meshes[i]; if ( === 0) { mesh.checkCollisions = true; mesh.visibility = 0; mesh.isPickable = false; } } } 3. Apply Scene/Camera settings: scene.gravity = new BABYLON.Vector3(0, -.5, 0); // You might want to play with the Y value. scene.collisionsEnabled = true; camera.ellipsoid = new BABYLON.Vector3(.5, 1, .5); camera.checkCollisions = true; camera.applyGravity = true; You see the pink bits? These are collision meshes in my Scene.