brianzinn

Members
  • Content Count

    765
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by brianzinn

  1. brianzinn

    Point to Plane question

    Planes have normals, which are perpendicular, so you can work from there backwards (computeWorldMatrix updates everything, if you move the planes around). The normal, if you are inside a box will probably be facing outwards, so you may not need to .negate() the Vector3 as I did. http://playground.babylonjs.com/#QZH25V If you don't want to write any math, you can use rays like in the PG. Otherwise the normal of a plane can be calculated as the Cross from subtracting the corners (see comment in PG). https://en.wikipedia.org/wiki/Normal_(geometry)
  2. Here's one way using observables: https://www.babylonjs-playground.com/#12MKMN#3 Another way is to set MirrorTexture activeCamera and use a layer mask. edit: And welcome to the forum!! 😮
  3. Thanks for clarifying and adding the important distinction (and PG) between rendering FPS and animation frame rate. I was just thinking about rendering FPS as the question was in terms of slower devices
  4. Yes, and that's what makes the animation work well and not need to compensate for different FPS rates! In other words, if the animation knows how much to move in 1 second then only the duration of time is important, not the frame rate. If your frame rate is twice as fast, you will move 1/2 the distance on each render.
  5. Yes, when FPS slows down then animation FPS is also affected - as they are the same. Animations are done as part of render loop. If you were to write your own smooth animation irrespective of frame rate, you would take the amount of time between the frames (delay) to determine how to proceed with the animation: delta calculation: https://github.com/BabylonJS/Babylon.js/blob/6a359893cba45ba93de744027370c54910fac5aa/src/babylon.scene.ts#L2602 animation next frame calculation: https://github.com/BabylonJS/Babylon.js/blob/master/src/Animations/babylon.animatable.ts#L344 If you were writing your own simple animation then you could just use engine.getDeltaTime(), but animations in Babylon have a lot more going on (options, pause, weights, frame sets, easing effects, etc.). If you are using physics then you can notice slower devices behave differently - the timeStep can help there, but looks like you are just on animations. Also, if you are doing collisions with less FPS then there are differences as well. Cheers.
  6. brianzinn

    importScene of undefined from undefined version

    I think he meant that he recreated the .babylon file, so it was maybe corrupt. If you are using ReactJS and 'react-babylonjs' then a declarative model component was added and you can do: <Model sceneFilename="file.babylon" rootUrl="/assets/" />. Please ignore that, if you are not using ReactJS.
  7. brianzinn

    Can we customize the look of BabylonJS.GUI?

    i've worked a bit on building menus like that for my game. Should be able to accomplish all of that with some buttons, stack panels and (hover) animations. https://www.babylonjs-playground.com/#Q81PBV#6
  8. brianzinn

    Ambient Light Discussion

    scene.materials is not observable, but you could make your own class that monitors for changes using a map (http://doc.babylonjs.com/api/classes/babylon.material#id). at least that would be somewhat more automatic, assuming you don't have full control over when materials are added. edit: I am wrong - looks like it was added two days ago!!
  9. brianzinn

    Fire ray from player camera?

    @Deltakosh - I couldn't find that in source and my PG fails with "pickResult.pickedMesh.getFacetData is not a function"
  10. @Nodragem I've made a demo for you. I think you will be underwhelmed with this example, as I'm currently not able to, for example, maintain an animation. One reason for doing it this way, is that I'm able to change mesh (ie: box) size, which requires me to rebuild that part of the scene. Nevermind the wierd markup in the demo, as I'm using React as well to wrap the BabylonJS objects, but this gives you an idea - you can super easily do it without React. You can change the cubes color, move them around, move camera, change lights, change cube rotation axis/speed. I have started on a reactive project using vue that does similar, but I think I will write an intermediary representation like proxies to share between the projects for full HMR even resizing meshes by updating vertices data - then you could do things like change cube colors during an animation. I just am really low on time these days to pursue it at all I am changing same instances of menus on the fly without HMR, too. You can see that on the Panel (+2D UI) page. https://brianzinn.github.io/create-react-app-babylonjs/with2DUI The HMR was I just added in this changeset: https://github.com/brianzinn/create-react-app-babylonjs/commit/6d9f6ba0db70b7ebd6f568ba1ea4ae8954d8fd48 I do some more involved HMR on the 3D level editor I'm working on, but it's just for development not end-user. I'm managing with external state, if you are wondering. I think that once you get started that it you will see it's quite easy to get at least what I have there - it took me more time to make that .gif than to add HMR - it's my first screenshot gif!! yay Cheers.
  11. brianzinn

    Fire ray from player camera?

    Luckily you don't need to know any vector math Here is a PG: https://www.babylonjs-playground.com/#45W3XB#1
  12. HMR you can do right now, but you will be brought back to your initial state, so it is not that useful. HMR is an essential part of my workflow. I have had limited success (mostly because of physics on moving objects) with HMR and restoring an in-progress game and 3D level builder by replaying state changes on init, but I have a simple puzzle game. I'll try to put up an example tonight.
  13. brianzinn

    Cannot open in VR

    Hi, I have been working on a "remix mesh mashup"; A Remix3d.com mashup that worked more how I would like completely in VR as follows: 1. Show model download progress (that moving "L" piece doesn't show progress). Frustrating for big models on slow internet. 2. Wanted to be able to click the list of models (and search) from within VR to show right away in 3D - resized to a consistent dimension. 3. Wanted to be able to walk around the models with controller teleportation. Remix3d has no direct way (you can download, open in Paint3D or open in Mixed Reality (PC camera)). So, I managed to get a working version, but it fails when entering VR mode - looks like the GUI are not being correctly restored after the canvas is lost. As a wild guess, I think array buffers pointing to old context. I have a PG and my actual demo both failing in WinMR and GearVR: https://www.babylonjs-playground.com/#0JMGVC#11 https://brianzinn.github.io/create-react-app-babylonjs/meshMashup I would have posted as a bug, but I have a feeling I have done something wrong, as the PG was working up till near the latest version. Can you see why this would not load in VR? Thanks. edit: I have tried alpha.15 and all beta versions. differing results somewhat, but none are working. edit2: WinMR Microsoft Edge 42.17134.1.0. GearVr on Samsung Internet latest version.
  14. brianzinn

    Cannot open in VR

    Must be a driver issue, although the drivers were 6 months old - updating to Sept. 10 drivers does not fix. Marking as solved - thanks a lot for your efforts! Maybe I need a new computer! Always looking for an excuse...
  15. brianzinn

    Cannot open in VR

    I'm going to look for any video card updates or maybe I need to rollback, because I'm nearly positive that PG worked on my PC before whereas now it is failing (see black screen where the color chooser should be):
  16. brianzinn

    Cannot open in VR

    I should add that is the first error coming in, there is nothing before that. You can't see the scrollbar elevator, but it's at the top.
  17. brianzinn

    Cannot open in VR

    @trevordev Thanks for troubleshooting the website. I should not have brought that up as it was just a secondary place where it was failing! Let's please just try to get the PG working and forget the website Here is what I see in the PG: Here are the WEBGL Errors: I'm not getting stack traces or anything, just errors. So, we are using the same version of Edge. I have a less capable video card surely, but I have never had any issues before. I have an NVidia GTX 1050, which is bottom for capabilities of WinMR. Are you saying that the PG is working for you without any changes?
  18. brianzinn

    Cannot open in VR

    I can send the WEB_GL errors in a few hours. Same version of Edge, so that is not it!
  19. brianzinn

    Cannot open in VR

    I am writing in neither, it's a declarative markup: <VRExperience createDeviceOrientationCamera={false} teleportEnvironmentGround={true} enableInteractions={true} /> The markup is using code written in TypeScript that has no warnings. I will investigate that further, as I don't recall having any warnings, but I may have done an update since. Thanks for your help.
  20. brianzinn

    Cannot open in VR

    I have a fix for keyboard depth. Actually want to disable keyboard for mobile as it uses prompt. For VR - which headset are you using that it works? Also, which version of browser. Thanks.
  21. brianzinn

    Babylonjs and dependencies in NPM

    You should match the versions of all NPM projects for best results. Do you mind me asking why you are not updating GUI? For the shader I would create a new specific question, but make sure you have set the static Engine.ShadersRepository, if needed, and that files are being served to browser.
  22. brianzinn

    Cannot open in VR

    If it's helpful in narrowing down the issue, the earlier PGs do, in fact, load correctly in VR. This would lead me to believe that AdvancedDynamicTexture is somewhere the culprit [don't quote me on that ;P], as if I recall correctly, it does work with 1 ADT. Let me know if I can help at all or do any testing. Cheers.
  23. brianzinn

    Virtual Keyboard depth

    I figured something with blend mode, but couldn't connect it that way. That also explains the onlyAlphaTesting parameter for CreateForMesh(). Got it. Thanks!
  24. Hi, I have a Virtual Keyboard rendering behind Button3D and in front of a regular mesh (when physically in front of both). Has anybody come across this? https://www.babylonjs-playground.com/#0JMGVC#6 If there's not something I have missed (renderingGroupId does not work) then I will keep investigating the ordering Textures are rendered. Thanks
  25. brianzinn

    How to join two walls as one?

    I don't know a way to merge meshes without updating positions. If you can make a playground then I can possibly provide a solution - you haven't provided any code or model, so it's hard for me to imagine what you have tried or to propose a solution. Maybe somebody else can help without a 3D model or code though?