JohnK

Members
  • Content count

    1,093
  • Joined

  • Last visited

  • Days Won

    24

JohnK last won the day on May 12

JohnK had the most liked content!

2 Followers

About JohnK

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://babylonjsguide.github.io/

Profile Information

  • Gender
    Male
  • Location
    England, Buckinghamshire

Recent Profile Visitors

4,568 profile views
  1. Had play around and produced this result using a method that may be developable but at the moment is a bit fiddly and not very user friendly. Here is the playground I used https://playground.babylonjs.com/#2XZ6M5#1 Method Create two planesl perpendicular to each other for walls. Use an arcRotateCamera, with initial target (0, 0, 0) and radius 100, alpha -Math.PI/2 and beta Math.PI/2. Rotate camera until bottom of both planes are near parallel to the wall in the image. Using the results in the console read the alpha value and substitute in the alpha value in the arcRotateCamera constructions. Play around with the camera target value for y and the wall position for y and the x value for the wall position until the join of the two planes lies on the image as close to correct as possible. create box that has the transformNode as a parent using these value to place the box in the corner of the two planes at floor level. box.position.x = width /2 - size / 2; box.position.y = -height / 2 + size / 2; box.position.z = -size / 2; Subtract and z values to move box into "room". Whether GUI sliders would make the operation easier is yet to be determined.
  2. Hi and welcome @devour Have you tried applying the same dynamicTexture to each mesh? In this playground different text is written on different rectangles using SPS system and one large dynamicTexture. It should be extendable to meshes other than rectangles. https://www.babylonjs-playground.com/#A9K31I#2
  3. Using GUI is probably the best idea. However if you want to use dynamicTexture then read on. For the text not to stretch the width and height of the mesh must be in the same proportion as the width and height of the dynamictexture. Instead of a single number as the second parameter you can use an object which has width and height as properties ie {width: width, height: height}. The next issue is that when the fourth parameter (generateMinMaps) is set to true the width and height of the dynamictexture will be changed to the closest power of two and so also change the proportion of width to height. Two methods 1. rectangle width = 100, height = 120 then for any n use dynamicTexture("mytexture", {width:100*n, height:120*n}, scene, false) 2. Use powers of two for width and height of rectangle rectangle width = 128, height = 256 dynamicTexture ("mytexture", {width:128*n, height:256*n}, scene, true)
  4. Reverted and simplified somewhat. Now only uses one buffer not three and that is integrated into the core blocks, so a bit more like the original method. Can move in any direction but still with the same warning as before. Next stage is to see if I can smooth out the loading by breaking it up into sections that occur during the forward motion between the trigger points for resetting the blocks. Will be away for a week so nothing new soon. https://happy-hamilton-38ec27.netlify.com/workercoreblocks22
  5. JohnK

    Problems with pivot and rotation

    Hi @ichbinrob as a simple minded man here is a simplified PG with simple code simply using TransformNode instead of setPivot. May not be exactly what you want but could give you some ideas or another approach. http://www.babylonjs-playground.com/#RIUM9U
  6. JohnK

    Tutorial Talk

    JohnK rides to the rescue 🏇______________skids to a stop 🚏and falls off the horse 🤾‍♂️ failing to complete the task. On pulling the docs I still found only ### not #### for Line spacing and Resize to fit. Ahhahhh I thought simple correction. Not so simple adding the extra # results in changing the font size ( as seen on my home puter) Current Docs New after merge and build (yet to be done) but you are correct the TOC appears to ignore anything more than ###, this happens on all pages with 4th level subheadings. Probably a good idea as subheadings at this level would make the TOCs long and messy.
  7. A new version using web worker with some tidying up of code and slight improvements, same warnings as before. https://happy-hamilton-38ec27.netlify.com/workercorebuffered20.html My next task is to actually get round to doing NE type movements.
  8. JohnK

    Dynamic axis length

    If the model is not changing size etc after loading you could try forming a dummy mesh by merging all the meshes of the model without deleting the model, dis-enable the dummy so it does not appear and find and store the info from the bounding box of the dummy and then dispose of the dummy. Never tried it but it might be worth a go! 😊
  9. JohnK

    Dynamic axis length

    You can use bounding box to calculate width, height, etc of a mesh. PG https://www.babylonjs-playground.com/#10JFPK#4
  10. Had that problem sometimes. I think it is to do with moving forward before the loading blocks have finished loading. Try single one press on up arrow then pause before another quick tap on key. Not a satisfactory method and am looking at ways around it. Could mean going back to a loading screen during loading and making user wait until all blocks are loaded. Then maybe rather than loading new blocks every time you cross into a new block load a larger number of blocks when you get near the edge of the loaded blocks. Since Javascript is sngle threaded there will always be a hexitation when new blocks are loaded. Just depends on the way you choose to deal with it. On the other hand it mght be some other bug I missed.
  11. JohnK

    Lamps on Babylon / Open Contest!

    Edit your first post in this topic, this allows you to edit the title.
  12. @Luigi and @Pryme8 further developments, but still a long way to go. Use this example with the provisos below https://happy-hamilton-38ec27.netlify.com/mapim15 Give time for blocks to load. Click to use keys. Use keys slowly one press at a time (otherwise no time for blocks to be loaded). You start facing North, use left and right arrow keys to turn, only move forward (or backward) when facing north, east, south or west (NE etc as yet gets out of phase because of loading) There are now 225 blocks alternating between black and white ground and boxes and spheres. A grid of 7 x 7 blocks is loaded at any one time with a 3 x 3 grid enabled. Loading method changed from `append` to `import`. Need to give even more thought to which blocks need loading at any point. As this challenge interests me I will keep playing. Any suggestions for anybody welcome.
  13. JohnK

    Playground 'Drag & Drop' problem

    The ground is needed as a reference point for the move. See line 91 in the PG which calls the function getGroundPosition lines 71 to 80. You can always make the ground larger and invisible https://www.babylonjs-playground.com/#17EGSU#11
  14. A simple 3D vector field, very basic but gives you an idea of what can be achieved. Hope your learning is going well. https://www.babylonjs-playground.com/#536W7J#0