JohnK

Members
  • Content count

    1,189
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by JohnK

  1. @timm Reference your questions above 1. Do not have an immediate answer but have an idea I will try later 2.1 In some sense by using a tiny offset you are doing in 3D the HTML/CSS equivalent of setting a different z-index, so yes this is the way to do it. 2.2 It is because you are setting the opacityTexture of your textMaterial based on your textTexture which is a black and white image making the white areas transparent, just remove line 148 https://playground.babylonjs.com/#G1MBAL#19
  2. @tham_kathy as it says in the docs and You have given the base data in clockwise order. Reversing the data pairs and relabeling the planes to match this new order gives https://www.babylonjs-playground.com/#RVPAJ4 To change an existing playground just edit and save, the playground number will just increase to the next available number, real easy.
  3. I am busy for a few of days. Have a read of http://doc.babylonjs.com/babylon101/first as it is much easier for someone to work with a playground. Could be the end of the week before I have time to try out your HTML file.
  4. Hi @timm and welcome to the forum from me. Well done with your solution. Here is an alternative using extrudePolygon but probably no better than yours as it has a couple of disadvantages 1. Edge rendering round circles shows up 2. You can see in the docs that for non-playground use extrudePolygon requires Earcut to be installed. Also note that the path for the polygon needs to be in XZ plane
  5. JohnK

    issues with toEulerAngles

    Whenever the rotationQuaternion is set for a mesh then rotation values are ignored and setting a value for mesh.rotation will have unpredictable results. So set a variable to mesh. rotationQuaternion.toEulerAngles() , null the rotationQuaternion and then set the rotation to the stored value. See the difference when you comment out line 48 is http://www.babylonjs-playground.com/#1ST43U#77
  6. Found some raw data here added some commas and turned into an array and could not save the array in the PG as got `too long` message so had to add as external file to get https://www.babylonjs-playground.com/#WZNWVG#10 Give it a moment or two to load up. If it says 'positions not defined` click the RUN button.
  7. JohnK

    How to join two walls as one?

    Doors work OK if you need them. A bungalow http://www.babylonjs-playground.com/#1Z71FW#4 based on this one (very loosley)
  8. JohnK

    How to join two walls as one?

    Here we go, have re-written the buildFromPlan function and now you can use an interior: true within the options. This builds one or more walls that do not join end to start. After building the main walls you can add interior walls by giving positional coordinates, based on the base data. As the walls are given thickness in the direction away from the origin if you find the depth of the wall is on the wrong side just reverse the corner coordinates in the array, ie [4, 2, 4, 8] becomes [4, 8, 4,2]. Here are some of examples http://www.babylonjs-playground.com/#P3N8ZF#1 http://www.babylonjs-playground.com/#P3N8ZF#2 http://www.babylonjs-playground.com/#P3N8ZF#3 Doors and windows should work but have yet to try that.
  9. You can assign colors directly https://www.babylonjs-playground.com/#WZNWVG#8 https://www.babylonjs-playground.com/#WZNWVG#9 Possibly my imagination but seems to load a little quicker.
  10. Following an idea by @Wingnut here is an attempt at generating particles (Wingys addition) along a type of spirograph type of generator. I say 'type of' since I am not entirely sure I have the maths correct for multiple circles, however the patterns are pretty https://www.babylonjs-playground.com/#1BTGPV#15
  11. JohnK

    How to join two walls as one?

    In my mind the interior walls should appear on the floor plan, hence their x and z coordinates are apparent, the rest can be calculated from there. Actually I have a bit of time on my hands I will look at automating over the next couple of days.
  12. JohnK

    How to join two walls as one?

    Easiest way is to only use buildFromPlan for outer walls and then use boxes and adjust position according to outer wall measurements https://www.babylonjs-playground.com/#WKMCNK
  13. Have been having a play around to see if I could get anything with faster fps. First try is to build a mesh just from the points data and use pointsCloud on the material. No indices, no normals so no light just black points https://www.babylonjs-playground.com/#WZNWVG The only way I could think of to add color was to form small triangles around each point and then I realised that if I did that and put the mesh into billboardMode the points cloud would already exist https://www.babylonjs-playground.com/#WZNWVG#1 3 million points (that's 9 million vertices) is possible but not at 60fps, I was getting 25fps on my laptop https://www.babylonjs-playground.com/#WZNWVG#2 Since normals will always be (0, 0, -1) because of the way the facets are constructed they can be added at construction rather than calculated later (only 300 000 points this time so waiting not too long) https://www.babylonjs-playground.com/#WZNWVG#3 For info offset determines the size of each of the triangles. Have fun
  14. JohnK

    Draw Calls

    This is one way http://www.babylonjs-playground.com/#4GBWI5#2
  15. Am going to give writing the Wikipedia page a try. So far the admin has said that 'notability' has been a missing feature in attempts so far so trying to link in to as much evidence as possible. Will let you know if I make any progress.
  16. For no good reason I was thinking about physics engines and came across this. As I was looking for a new challenge I took a look and as BitOfGold said the API is horrible but though I would give it a go. I took this example and had a go at making it work with Babylon. Never having worked with 'workers' before I had a go at doing a test with a direct implementation with Babylon.js which is here and if anyone is interested the code is at github. Very early days but slowly over the next year I will have a go at seeing what is possible and if getting somewhere will see whether it would make a good extension with added documentation. As a very amateur coder however I have a lot to learn for example how do I use ammo.js without enclosing everything in Ammo().then(function(Ammo) { }) Anyone else interested in seeing what is possible with Ammo.js and Babylon.js the let me know.
  17. JohnK

    New Babylon.js GUI Helper

    The new container SelectionPanel lets you add groups of checkboxes, radio buttons and slider relatively quickly. Example Full docs
  18. Hi @jmb462 if you have not done so already I suggest you read the following documentation pages http://doc.babylonjs.com/babylon101/position http://doc.babylonjs.com/features/position,_rotation,_scaling http://doc.babylonjs.com/how_to/pivots http://doc.babylonjs.com/how_to/pivot http://doc.babylonjs.com/resources/rotation_conventions From your earlier post I see that you are "planning to make a rubik's cube with babylon. I'm new to babylon and javascript ." A challenging task - good luck.
  19. JohnK

    Multiple Scenes Approach

    For scenes that have shared meshes another possibility is to have these in one scene, with (for want of a better term) multiple scenarios, on swapping scenarios from S1 to S2 use mesh.setEnabled(true) for meshes in S2 and mesh.setEnabled(false) for meshes in S1 but not in S2. Shared meshes will already be enabled.
  20. JohnK

    Multiple Scenes Approach

    A search on multiple scenes in the docs lead to http://doc.babylonjs.com/how_to/multi_scenes
  21. JohnK

    create a box with one side open

    Create a couple of planes, position correctly and merge box and plane. By the way if you want a rectangular open box the I suggest you use extrusion rather than tube to create the box. Just define the shape for the extrusion as a rectangle http://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes
  22. JohnK

    moving a box in a square manner

    Here is an example of a cube moving along a curve. https://www.babylonjs-playground.com/#92EYG#21 Following a rectangle has the problem of what to do at corners. Another way to go is to use animations one after the other do an animation to move along one side, animate around corner and repeat. Start here http://doc.babylonjs.com/babylon101/animations and then search docs for animation. Set up a playground with your attempt and any problems ask away.
  23. JohnK

    create a box with one side open

    Hi @reggie and a warm welcome to the forum from me. Easiest way is using a tube http://www.babylonjs-playground.com/#165IV6#453
  24. The attempt I have just added to demos and projects sub forum uses much more basic coding and no circles to be seen. * moderator added the link
  25. Not so much, the patterns you get for standard spirograph ratios do not match those I generate. Back to the drawing board!