brianzinn

Members
  • Content count

    77
  • Joined

  • Last visited

About brianzinn

  • Rank
    Advanced Member
  1. You mention your first thought was React... If you're looking for some React sample code this started kit uses an npm for React and BabylonJS. You could easily do a modal form with 'react-boostrap' npm. The demo here is Quarto is from temechon moved partially to React as a proof of concept: https://brianzinn.github.io/react-redux-babylonjs-starter-kit/quarto
  2. OK. It would be interesting to make a demo for adjusting the HMD parameters (using GUI sliders). What parameters do we need to change to support different devices? Each cardboard is different - it is the QR code that adjusts HMD parameters. Also, for which device do the defaults work on?
  3. The controller works with the gamepad camera (http://www.babylonjs.com/demos/mansion/), so I figure that I can get that going. Let's just leave the controller out for now. Head tracking works, but the scene is blurry in 3D (double vision). This page (https://mozvr.com/webvr-demos/demos/vihart/monkeys.html) does work, so it shows at a minimum that my phone is setup correctly to view 3D on a webpage. The playground from my first post is blurry as well (http://playground.babylonjs.com/#ASDZLT#24). Actually, it's the same with google cardboard (different phone) - it works on the mozvr size, but the babylonjs demos are blurry/double-vision, so quite possibly I am doing something wrong. Anyway, if anybody has a gear VR and has a babylonJS page working in 3D not-blurry then I would be interested in hearing about how. Thanks.
  4. Are your meshes pickable (mesh.isPickable = true) or otherwise use the 3rd parameter of scene.pick, which is a predicate (and also camera, in case you have multiple viewports/cameras). https://doc.babylonjs.com/classes/2.5/scene#pick-x-y-predicate-fastcheck-camera-rarr-pickinginfo-classes-2-5-pickinginfo-
  5. OK. Would be nice if Gear VR was supported for BJS 3.0. in Q1 of this year more GearVRs were sold than Google, HTC, Oculus, and Sony combined.
  6. Ray tracking and 3D head tracking at the same time - cannot seem to get them working simultaneously.
  7. Does anybody have this working on a Gear VR with the controller (head tracking + ray tracking in 3D)? I put up a Q&A, but seems nobody has an answer there
  8. Deltakosh has the answer, but just wanted to add that in case you are trying to unparent a child mesh and keep rotation, in BJS 3.0 there is a setParent(mesh) in AbstractMesh - pass in null to unparent. https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.abstractMesh.ts If not then here is a code sample of using decompose - don't forget to check if rotationQuaternion has been set, because otherwise rotation will have no effect: // here is how you could unparent a child mesh, while keep rotation and position. var rotation = Quaternion.Identity() var position = Vector3.Zero() child.getWorldMatrix().decompose(Vector3.Zero(), rotation, position) if (child.rotationQuaternion) { child.rotationQuaternion.copyFrom(rotation) } else { rotation.toEulerAnglesToRef(child.rotation) } child.parent = undefined child.position.x = position.x child.position.y = position.y child.position.z = position.z
  9. Well, at least it's an example of how to do it the way you were thinking. It kind of makes sense that if the 'from' is lower than 'to' that BJS could use that to play the animation backwards. I was just showing you my search, since you mentioned you had searched - I think it helps if 'babylonjs' is an early search term.
  10. it's isPickable, but it's true by default, so not sure if that would be causing it. It's the only way I've seen something being not pickable unless I had multiple viewports. https://doc.babylonjs.com/classes/2.5/abstractmesh#ispickable-boolean
  11. We have posts in this forum for reversing animations (search google "babylonjs scene beginanimation reverse" - 3rd link for me). Here is a PG: http://www.babylonjs-playground.com/#1LNWLE#3 Here is the forum post from wingnut:
  12. Are they pickable - ie: in loader set importedMesh.isPickable = true?
  13. If you attach a mesh to your camera (parent) then when that mesh collides with the bottom of the escalator you can trigger an animation (code is untested): var cameraStartPosition = new BABYLON.Vector3(cameraMesh.position.x, cameraMesh.position.y, cameraMesh.position.z) var topOfEscalatorPosition = new BABYLON.Vector3(newPosition.x, newPosition.y, newPosition.z) var keys = [] keys.push({ frame: 0, value: cameraStartPosition }) keys.push({ frame: 30, value: topOfEscalatorPosition }) var cameraAnimation = new BABYLON.Animation('escalator-animation', 'position', 30, BABYLON.Animation.ANIMATIONTYPE_VECTOR3, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT) cameraAnimation.setKeys(keys) camera.animations.push(cameraAnimation) this.scene.beginAnimation(camera, 0, 30, false, 1, function() { console.log('top of escalator. animation done.'); } You can do tests on camera position to see if you should trigger the animation, but you could also test if a mesh parented to your camera collides with the bottom of the escalator by putting a mesh there or you can do a position test - something like: const goUpEscalator = this.cameraMesh.intersectsMesh(bottomOfEscalatorMesh, false)
  14. Hi, I had already some meshes with text that I had made into buttons and am trying to convert them to use GUI. I have a PG with 3 things that I would like to add: 1. I have the AdvancedTexture on 2 sides of a mesh. Notice that if you rotate the scene 180 degrees that the "back" button is being displayed in front of the front (So, text appears mirrored). 2. I would like to see the original mesh. 3. Optionally, would be nice to have mouse-over with a hand icon cursor. I think this is easy with pointerEnterAnimation. https://www.babylonjs-playground.com/#CL8C6T The box on the left uses GUI - the box on the right has all 3 things. Thanks.
  15. Actually, I do have an opinion about the class name, while we are on this topic. I think choosing Image as the name of the class can lead to issues in the future. If somebody does an ES6 import from babylon GUI like: import { Image } from '/babylonjs/gui' Then they will be unable to create an HtmlImageElement with the typical constructor new Image(height, width). They would need to alias the import - ie: import { Image as GuiImage} from 'babylonjs/gui'. So, I would have to say that I think that class name is maybe not the best choice. Looks like it required also a global declaration, which could be clobbered. I have it called ImageControl, so maybe not as good of a name. It's always hard to name things...