brianzinn

Members
  • Content count

    483
  • Joined

  • Last visited

  • Days Won

    3

brianzinn last won the day on March 4

brianzinn had the most liked content!

3 Followers

About brianzinn

  • Rank
    Advanced Member

Profile Information

  • Location
    Vancouver, BC

Recent Profile Visitors

1,406 profile views
  1. 3D Level Editor

    A bit on the early side, but I've been working on a 3D level editor and a game to go with it. I did look for 3D WebGL map editors when I started and didn't come across any open source (besides Voxel type) and I want to use ie: glTF models inside the editor and integrate in a game and one day a easy to use game creation engine. The editor itself will be open sourced (right now it's too tightly integrated with the game). Hoping it will make game development easier and faster for games with small maps (2D, 2.5D or 3D) - users often have better ideas than game creators ever could have imagined! Partly inspired by this project https://brianzinn.github.io/react-redux-babylonjs-starter-kit/quarto (I copied the game from @Temechon). The first version of the level editor is here: http://robolo.co/game/build It's very PoC (Proof of Concept) material with lots of known issues and bugs. My next idea is instead of having the semi circle of things to instead have a tray that slides out in front of the board (and board slides back). Then I won't need all the popups with tiny text and it will work in VR. Right now the levels that you create can be published to the game, but not always published correctly, sorry . Publishing a level creates a URL you can share, though! To give an idea of how some bots work I created a 4 level tutorial: http://robolo.co/game/play (if the roboloco logo is spinning a level is loading... i'm on an affordable tier!) The game received lots of constructive feedback from an Indie game dev meetup this week, so will be working on those ideas, but unfortunately really busy on other things as well So, back to the drawing board... again. Thanks!
  2. How do you teleport in vive/steamvr ?

    Did you try holding the trigger down for a short duration? According to the docs the trigger will fire the right event (https://doc.babylonjs.com/how_to/webvr_camera). I don't have a Vive, so can't help otherwise.
  3. Some Bugs*... UI and other stuff...

    #3: linkWithMesh(...) only supports AbstractMesh or higher and is by design, as it's using boundingbox. (ie: change anchor to new AbstractMesh(...).
  4. Babylon.js: A double array to 3d

    Those will help along with many other possible optimizations (https://doc.babylonjs.com/how_to/optimizing_your_scene). JohnK's 250K box demo is pretty impressive and is running 60FPS on my laptop...
  5. Babylon.js: A double array to 3d

    My game builds blocks side-by-side in 3d as well. I do believe that using blocks and detecting occluded faces has a performance penalty. I'm not an expert, but imagine freezingWorldMatrix() or instances probably more performance gain (https://doc.babylonjs.com/how_to/how_to_use_instances). You are measuring FPS, but it can be CPU or GPU constrained. Only way that I would know how much of a gain is by building and testing, but you were focusing on unneeded faces, so I thought it would be helpful to provide a specific solution
  6. Babylon.js: A double array to 3d

    I remember digging into this cool project once, if you really don't want to create the faces you don't need. You could do a similar loop, except he does 3d, while you are only in a double array, so your loop would be easier (ie: this example uses Array<Array<Array<...>>>). https://github.com/SvenFrankson/planet-builder-web/blob/master/scripts/PlanetChunckMeshBuilder.ts Basically creating meshes on the fly, but not adding a face if there is an adjoining block, which sounds like what you're after.
  7. I think only Samsung Internet (and Oculus Carmel) are supported for WebVR. https://webvr.info/ If you want to increase the resolution then you can increase the canvas size. I don't know if the playground does automatically, but did you try adaptToDeviceRatio (last param)? https://doc.babylonjs.com/classes/3.0/engine#new-engine-classes-3-0-engine-canvas-antialias-options-adapttodeviceratio- ie: new Engine(canvas, true, undefined, true); edit: Just checked on my s8 against the playground. Try this PG: http://playground.babylonjs.com/#EE38I5#3 It shows engine.getHardwareScalingLevel() == 1 (with devicePixelRatios of 1, 2.5 and 3 - I tested on those 3) and window.devicePixelRatio = 3 on S8. I think you need to run this in a PG, but in your own code you can do the new Engine(...) 4th parameter true: engine.setHardwareScalingLevel(1.0/window.devicePixelRatio); Edit #2: another thing to consider is that your screen resolution is reduced when gear VR starts up.
  8. You did say you were using source, but I was just confirming. You are correct - docs are only for NPM package. Stepping through bjs TS code with these instructions, but only for ie: Playground, Sandbox: VS Code - https://doc.babylonjs.com/how_to/how_to_start#debug Visual Studio - https://doc.babylonjs.com/how_to/setup_visualstudio I've actually never tried to step through a dependent project in TypeScript - another option is to use babylon.max and step into JS. Hopefully somebody can help you out.
  9. [SOLVED] Strange behavior of material

    Confirmed 2 red spheres on FF 58.0.2 (64-bit) Windows on stable, but LATEST is correct red and green. https://www.babylonjs-playground.com/index.html#ZM9G4E#3 edit: known issue. read more here: https://bugs.chromium.org/p/chromium/issues/detail?id=792966#c35
  10. You are using the babylonjs source? I haven't had any issues with NPM and webpack - here are the docs: https://doc.babylonjs.com/features/npm_support If that doesn't work can you provide more information - is your project TypeScript or JavaScript, which version of BabylonJS.
  11. Help! GL error since 3.2.0-alpha8

    Have you tried this: 1. add babylon.max.js as a script to your HTML: <script src="https://preview.babylonjs.com/babylon.max.js"></script> 2. add to webpack config: new webpack.ProvidePlugin({ BABYLON: 'babylonjs', }), I didn't actually try that, but should work. https://webpack.js.org/plugins/provide-plugin/ edit. or via externals: https://webpack.js.org/configuration/externals/
  12. what about this? I think I'm missing something: https://www.babylonjs-playground.com/#YQ7B8L edit: 2nd param in onCollideEvent has object.id === "Ground", so when ground check object.rotation(Quaternion) and you can determine orientation - if ie: character is upright vs. landing on head?
  13. Here's another way to look at it - depends if object.attribute is an object or a data type. ie: these look the same, but have different results. This is copying the object reference: meshA.position = meshB.position vs. copying the object values: meshA.position.x = meshB.position.x meshA.position.y = meshB.position.y meshA.position.z = meshB.position.z You use clone() to create a new independent copy. You could, however, assign without clone() like above - I likely wouldn't inline this code: https://playground.babylonjs.com/#EAXFJ7#2 The clone is just a shortcut and actually creates a new Vector3: https://github.com/BabylonJS/Babylon.js/blob/master/src/Math/babylon.math.ts#L1735 Vector3 also has a more memory efficient copyFrom() to not unnecessarily new up a Vector3 instance: https://playground.babylonjs.com/#EAXFJ7#3 If you look in the Math file you see lots of methods like xxx, xxxInPlace, xxxToRef. That lets use easily code our intentions and avoiding writing error-prone (and maybe harder to read) code in my example above
  14. You don't always have to clone the absolute position, but if you are going to *change* (ie: use for animation) or *assign* that Vector3, then cloning is good. Realize that the position is just a Vector3, so if you set two meshes to the same position: meahA.position = meshB.position When you move either mesh, both will move... It's not really the season, but check out this snowman that I just made for you. Try to remove the .clone() calls - it shows how the "instances" of position the same will lead to undesired results: https://playground.babylonjs.com/#EAXFJ7 position https://playground.babylonjs.com/#EAXFJ7#1 getAbsolutePosition() The takeaway is that BJS is highly optimized and will re-use the same instances. So, you need to be explicit in your code. edit: here is the code (https://github.com/BabylonJS/Babylon.js/blob/25023c1dc83925a513ed1186ec95f52c566b6d04/src/Mesh/babylon.transformNode.ts#L285). You are given access to an internal cache variable, which you're not meant to change. BJS *could* clone() it for you in the getter, but it's built for speed, so we clone() when required
  15. In the typescript it is explicitly an AbstractMesh, but I also tried in your PG and got an error: h.getBoundingInfo is not a function. I think it's from here: https://github.com/BabylonJS/Babylon.js/blob/62400581618983fd2b089b0a32347074427c9961/gui/src/advancedDynamicTexture.ts#L343 That getBoundingInfo() method starts on AbstractMesh: https://doc.babylonjs.com/classes/3.0/abstractmesh#getboundinginfo-rarr-boundinginfo-classes-3-0-boundinginfo- That method is not available on Node (That AbstractMesh derives from). Although, I don't see why it couldn't work for a Node.... the short answer is no. edit: can you get away with an empty mesh what you are trying to do?