PavolHejný

Members
  • Content Count

    9
  • Joined

  • Last visited

About PavolHejný

  • Rank
    Newbie
  • Birthday 09/08/1993

Contact Methods

  • Website URL
    https://www.pavolhejny.com/en

Profile Information

  • Gender
    Male
  • Location
    Czech republic

Recent Profile Visitors

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

  1. @trevordev Thanks a lot. Your code is working perfectly!
  2. Hi, I am using Babylon.js with HTC Vive and WebVR and I want to pick a point on the mesh (this.wallMesh) with controller ray. I don't want to use default VRHelper interactions. I expected that this code should work for it but it seems that there is wrong rotation because the rotation of the device behaves totally weird. Do you have some tips on how to fix it? Thank you a lot. const pickMesh = BABYLON.Mesh.CreateSphere( 'pickMesh', 5, 0.1, this.scene, ); const ray = new BABYLON.Ray( BABYLON.Vector3.Zero(), BABYLON.Vector3.One(), 100, ); this.scene.registerAfterRender(() => { ray.origin = controller.devicePosition; ray.direction = controller.deviceRotationQuaternion.toEulerAngles(); const hit = this.wallMesh! .getScene() .pickWithRay(ray, (mesh) => mesh === this.wallMesh); if (hit) { console.log(hit.hit); if (hit.pickedPoint) { pickMesh.position = hit.pickedPoint; } } });
  3. Hi, I am creating WebVR app with Babylon.js (using Firefox, SteamVR and HTC Vive). Can I somehow start VR without users initial click. When i create WebVRFreeCamera: const camera = new BABYLON.WebVRFreeCamera("camera", BABYLON.Vector3.Zero(), scene); I can start VR with: scene.onPointerDown = function () { camera.attachControl(document.getElementById('scene'), true); }; or scene.onPointerDown = function () { camera.getEngine().enableVR(); }; but when i do it without onPointerDown callback it does not work: const camera = new BABYLON.WebVRFreeCamera("camera", BABYLON.Vector3.Zero(), scene); camera.getEngine().enableVR(); Also when i wrap it with setTimeout it does not work: const camera = new BABYLON.WebVRFreeCamera("camera", BABYLON.Vector3.Zero(), scene); scene.onPointerDown = function () { setTimeout(()=>{ camera.getEngine().enableVR(); },100); }; Does enableVR method needs onPointerDown event context. Or where is the problem? Thanks a lot for your advice.
  4. PavolHejný

    Different gravity for different meshes

    Thanks for every advice. @Arte Setting inital velocity is good and easy hack for some cases. @brianzinn I think that is exactly the problem of Oimo. Oimo is physics in vaccum - everythink is falling with same acceleration. @Pryme8 Perfect hack!
  5. Hi, Can I somehow (with physics plugin Oimo.js) set different gravity for different meshes? For example I want to simulate environment in water and I want to have there buoyancy. https://www.babylonjs-playground.com/#2B84TV#7 Thanks a lot for your advice.
  6. PavolHejný

    BABYLON.Texture coverage uScale,vScale

    Thanks! That was exactly what I needed. And now I better understand how textures and meshes works.
  7. Hi, I have some questions about BABYLON.Texture. I have a bricks texture, a big house and a small chimney. I want one brick to be the same size on a house and on a chimney. I can set size of the texture by uScale,vScale, but I would not like to create a special texture for every mesh as I suppose it would be very inefficient. Can a Babylon texture cover the area by size instead of percentage? http://www.babylonjs-playground.com/#2TJ5MI Best comparsion of my problem is comparing with css background-size: CSS background-size: 100% 100%; is like uScale=1 and vScale=1 in Babylon. Is there anything like background-size:100px 100px; in Babylon? Thanks a lot for your advice.
  8. PavolHejný

    Vibrations in Babylon.js + Oimo.js

    Thanks, Now I understand what is happening much better.
  9. Hi, I'm making the game using the Babylon.js and Oimo.js. I want to put cubes one to the other and create bigger buildings - just like wooden domino or jenga cubes in real world. But if I put a lot of cubes one to the other, they will start to shake and the whole building will collapse. https://www.babylonjs-playground.com/#DCR6ZG#1 I can not figure out why this is happening? Can I somehow get rid of this vibration? Thanks a lot for your advice.