Search the Community

Showing results for tags 'solved'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Platform
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 1638 results

  1. I'm about to begin a whole lot of 3D-related R&D on making large multiplayer levels, and I'm here to get pointed in the right direction. As an example, how would a Babylon.js version of PUBG/Fortnite/Blackops have to be made? I've categorized some of the larger problems and offered a few guesses as for solutions, but am looking for feedback and ideas. I also know very little about 3D games so if y'all happen to simply know how any of these things works in AAA games I'd love to hear it. Edit: I already have the netcode that can do 50-150 players and all the first person shooter fancy stuff, so I'm just going to focus on rendering and collisions which I have no idea about Large Landmass (Terrain) Each of these games has a huge island. My guess is these are cut up into chunks and varying LODs. I've been reading through the bablyon docs and found mesh simplification stuff which sounds to me like it could handle making the lower LOD versions of chunks. There's also a function for subdividing meshes, though I'm not sure how that works and if it would be viable for cutting a larger object into spatial chunks, or if this is something to write some custom code for. Any suggestions? Rendering Buildings, Players, Props, etc I think this category is an extension of the terrain ideas (solved by multiple LODs), but with the added benefit that stuff that is truly far away wouldn't get added to the scene on the client at all. Collisions everywhere Unlike the client, the server has to keep the entire mesh of the game loaded. Luckily the server doesn't have to render it. But how do collisions on the server work? Every tick it has to stop ~100 players from falling through the ground or clipping through walls. It also has to calculate every shot landing. It is easy to use moveWithCollisions for a single player against a simple world -- but what happens when the whole world is one huge scene in NullEngine? Does putting every mesh manually into babylon's octree solve this? I'm totally willing to learn and implement spatial structures and custom collisions if needed. In one of my simple prototypes I tried to fire rays downwards from the players to allow them to jump up onto varying meshes. It worked great, and I make and crazy shape I wanted in blender, import it, and then climb up ontop of it. But as I added more and more players, and more and more rocks/obstacles I eventually hit a performance wall. Does an octree solve this? Is firing rays downwards even an appropriate technique? Any tips on any of these topics are appreciated TY
  2. Good day everyone. I am now works on my own huge project, which uses a lot of mathematical models. So, the problem is ,I have mathematical model of hexasphere from there And I need to create meshes from vertex data of this model. I'm using this: //hexaSphere - is object, created with library upper for (let i = 0; i < hexaSphere.tiles.length; i++) { let centerpoint = data.centerPoint; let x = centerpoint.x; let y = centerpoint.y; let z = centerpoint.z; let spawnVec = new BABYLON.Vector3(x, y, z); //here I should instantiace center of vector let buildPoints = []; for (let j = 0; j<data.boundary.length; j++){ let x = data.boundary[j].x; let y = data.boundary[j].y; let z = data.boundary[j].z; let point = new BABYLON.Vector3(parseFloat(x), parseFloat(y), parseFloat(z)); buildPoints.push(point); } let polygonalMesh = new BABYLON.MeshBuilder.CreatePolygon(""+i, {shape:buildPoints}, scene); } So, the result of this is (please, do not look on colored spheres and sticks, It was hard to remove from my project because of bad architecture, they are do not touching this part of code, it is isolated): It is not 3D, but 2D projections of each hexagon or pentagon to the XoZ BABYLON plane. I started to think about position, as "How to" said, but polygonalMesh.position = spawnVec; give me that result: How can I create meshes from vertices data in 3D space? I just can not test rotation, because if it's correct, it can be visible to match each other borders of morphed meshes. There is no way to use loaded mesh, because each of hexagon is different. This mathematical model do not use right hexagons, because it is hard co connect (mathematical theorem). And I am sure this library is correct, because I tested it with right hexagon (imported mesh with babylon-loaders.js, created it on blender) and tried to match each other rotation, so I got next result (green dots is rotation co-surface normales, do not look on them): And everything with math was fine: blue dots is 2 of 6 or 5 border points, red is centerPoints. I do not have right now screen of whole sphere, but it was sphere, not was MeshBuilder created. I just putted a copy of IMPORTED model on each center and rotated it with some linear algebra to check everything, before post here. So, my question is: how can I create polygonal mesh in 3D space, not his 2D projection, using BABYLON.MeshBuilder (or other BABYLON solution), because displacement of right hexagons and this mathematical model is too huge for acceptance (impossible to play, looks ugle and other), so I need dynamical creation. p.s There is impossible to create lovely playground example, because of library, but have the same problem. In arguments of array have all 3D spaces, but it is creating just 2D projection.
  3. Hi everyone, I have gui assets from my previous Unity project - mostly greyscale textures. That's because we've been using tint color on ui elements to make it easier to adjust color palette project-wide, and also to create color transitions on ui elements. Is there any way to replicate that behaviour in Babylon? The only thing I've figured out so far is to use the css hue filter, but I can't get even that to work. Here's a playground (the texture is not really suitable, but I just want to achieve a proof of concept)
  4. I have a rectangle interface with an onPointerOutObserver handler that hides the interface. In the first playground, I can move the mouse anywhere in the interface and it will remain visible. In the second, if I hover over the button in the interface, the interface is hidden. This is not intended behavior. If I set button.isHitTestVisible = false, the rectangle observer isnt triggered. But the button observables wont be triggered. I think the functions in question are _processObservables and _processPicking here fixed :
  5. Hi there I'm a newby in babylonjs and i'm trying to build a content viewer for 3d models adjusted to my needs. Now: Is there a method to disable backface culling for all meshes of a scene? I have tried it with scene.meshes, but i does not work: BABYLON.SceneLoader.loggingLevel = BABYLON.SceneLoader.DETAILED_LOGGING; BABYLON.SceneLoader.Append("../../", "...", scene, function (scene) { scene.meshes.backFaceCulling = false; for(var i=0; i<scene.meshes.length; i++) scene.meshes.checkCollisions=true; ... Help is much appreciated, Thanks! Ps: Additional question: Would it be possible to give all the backsides of the meshes one color?
  6. I am thinking that I might make an AbstractMaterial class, which would handle baking, assuming that the API is the same regardless whether EEVEE or Cycles. Fingers crossed, since baking was renderer dependent before, which sucked. Then make 2 sub-classes, STDMaterial & PBRMaterial, assuming a PBR can use bake textures. Big problem in trying to detect if baking is the same across renderers is I cannot find any user interface on baking, just output. Any one have a clue? This is the Render Tab, where baking used to be: FYI, this is not an old build. I just got tired of looking at those awful new default colors, so I set theme back to 2.79
  7. Hi : I am new beginner of Babylonjs , I want to load a mesh(.obj) by typescript. Here is my code (run in playground): class Playground { public static CreateScene(engine: BABYLON.Engine, canvas: HTMLCanvasElement): BABYLON.Scene { // This creates a basic Babylon Scene object (non-mesh) var scene = new BABYLON.Scene(engine); // This creates and positions a free camera (non-mesh) var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene); // This targets the camera to scene origin camera.setTarget(BABYLON.Vector3.Zero()); // This attaches the camera to the canvas camera.attachControl(canvas, true); // This creates a light, aiming 0,1,0 - to the sky (non-mesh) var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); // Default intensity is 1. Let's dim the light a small amount light.intensity = 0.7; // BABYLON.SceneLoader.ImportMesh("Rabbit", "scenes/","Rabbit.babylon", scene, function (newMeshes) { BABYLON.SceneLoader.ImportMesh("Rabbit", "scenes/Box/","Box.obj", scene, function (newMeshes) { var rabbit = newMeshes[0]; if(rabbit == null) { console.log("rabbit is null") } else { rabbit.scaling = new BABYLON.Vector3(0.1,0.1,0.1); console.log("I can see the rabbit"); } // scene.beginAnimation(skeletons[0], 0, 100, true, 0.8); }); return scene; } } When I load Box.obj I got a log "rabbit is null". but when i load a Rabbit.babylon file it work good. What happened when I loaded.Obj? Who can help me load .obj Mesh By Typescript? Thank you
  8. I've got procedural textures working, but I'd like to have it dynamic / animated (basically transparent quads, blahblah). I'm comfortable with the shaders and no issue with the folder set up for the config / fx file, but don't quite follow why my shader isn't updating - is this expected behavior? Any advice on the best way to proceed? I'm sure I can just roll a custom shader and make all this work, I'm just wondering if that's the way the functionality is intended to be achieved. i.e. are procedural textures only run at initialization?
  9. I'm completely stumped by my inability to rotate an imported mesh which is then cloned. It took me a long time to isolate the issue into a playground but I've finally done it and I'm sure one of you is going to tell me something obvious. I have a library of meshes (imported from GLB files). I clone a mesh and add it to the scene and I can set the rotation using clone.rotation = BABYLON.Vector3.FromArray([1,0,0]); The clone is successfully rotated, but almost immediately (on the next rendering call, I'm guessing) the rotation is lost on the clone. Which means that when I later set: clone.rotation = BABYLON.Vector3.Zero(); the object does not return to its original rotation. In other words, setting the rotation on cloned meshes seems to be cumulative. This behaviour differs from a built mesh which does exactly what I would expect. I have shown both examples in the playground - hopefully it makes more sense there!
  10. Hi! Please show direction in this problem: We have transparent plane and not transparent cube. In real shadows must be look like in attached picture. How we can get it? I trying: 1. find in forum )) 2. use two ShadowGenerator for one light (ha-ha) ) 3. use two identical lights and two ShadowGenerator for every light with one shadow reciever but I did not succeed ( How we can dispose this barrier? in ideas - use two light, shadowGen's, reciever's and mix computed texture from one recievers for other. But i think its wrong wrong and long decission )) i feel: must be simple right way!! )) Thank you for any ideas!
  11. Hi, I am building a openstreetmap-integration to Babylon.js and I like to only load tiles that need to be shown and dispose tiles that are not visible anymore. To do that I need some way to figure out what tiles are in the view. I already found BABYLON.Vector3.Unproject which I could feed with the screen width/height divided by 2 in all directions to calculate the dimensions of the viewport in babylon coordinates. I only manage to get this working when the camera is directly in front of the screen, so I need to figure out how the distance from the camera to the screen can be used, see: Can anyone tell me how I get the dimensions of the viewport at a cirtain distance in babylon coordinates?
  12. Assuming all I can pass to a function is the major objects (scene, canvas, camera, etc) what is the best way to reference a specific Mesh? I am hopeful that I can create a function with a constructor like: function moveMesh(meshName, scene){ //select the namedMesh victimMesh.position = new BABYLON.Vector3(0,0,0); } I will actually create a key set to animate the Mesh move, but I am not skilled enough in JS to know how to select the child object I want. I know I saw the method in one of the tutorials, but I have watched over 40 hours of tutorials on youtube and can't remember where I saw it.
  13. Hi, How to get/calculate the Area and Center of a Facet of a Mesh? Thanks in advance.
  14. Hello there! I'm going to take my website and great native app using Android studio. My question is since I only have a landing page created with BJS could I copy and paste the code into it or not? Has anyone here used AS before and how was It? 💛💚, Mekaboo
  15. Hi Gurus, I have a single BABYLON.GUI.SpherePanel in my application. In VR mode, the user teleports here and there. When the user clicks on a mesh, I want the panel to appear in front of him (camera?) (The panel might be somewhere else but not it should appear in front of his camera). I have been struggling day and night to achieve this. Please help me. It would even be great if everything else in the scene is hidden except this panel until the user selects a button from the panel. (like a model window) Thanks in advance.
  16. Hi, A strange problem, I have a SpherePanel with some buttons. I am using Oculus Go. The white color line coming from the controller is not reaching upto the panel even though the panel is very close. (May be it is thinking that there is no clickable stuff ahead). var button = new BABYLON.GUI.HolographicButton(Id); this._guiPanel.addControl(button); var evt = new BABYLON.ExecuteCodeAction( { trigger: BABYLON.ActionManager.OnPickDownTrigger, parameter: 'r' }, someCallback); button.isPickable = true; button.actionManager = new BABYLON.ActionManager(_this._scene); button.actionManager.registerAction(evt); button.onPointerDownObservable.add(someCallback); I am setting both BABYLON.ActionManager.OnPickDownTrigger and onPointerDownObservable (I really don't know whether I should subscribe to both the events are which one) but it is not reaching upto the buttons. Please help me.
  17. Hi, I have a room designed in Unreal. I exported it as Fbx, imported this Fbx into Blnder and exported as Babylon file. But the babylon file is not displayed properly. (screen shot attached). No errors were reported during these conversions and all the texture files are there in the required location. No errors reported during loading of the babylon scene. I could not understand what is the mistake I did. Can you please help me on this? Thanks in advance.
  18. Considering this code: var shippingContainer = BABYLON.MeshBuilder.CreateBox("Box", { depth: 3, width: 2, height: 2 }, scene); shippingContainer.position = new BABYLON.Vector3(0, 2, 0); Have I moved a corner of the box to 0,2,0, and edge, or the center mass? Are there any good playgrounds that would clarify this?
  19. Hi when I load the Babylon Playground WebVR Example I get the following warnings in the developer console: BJS - [13:51:04]: Missing button mesh with name: THUMBSTICK_PRESS BJS - [13:51:04]: Missing button mesh with name: SELECT BJS - [13:51:04]: Missing button mesh with name: GRASP BJS - [13:51:04]: Missing button mesh with name: MENU BJS - [13:51:04]: Missing button mesh with name: TOUCHPAD_PRESS When I press any buttons the scene freezes and I get this error message: SCRIPT5007: SCRIPT5007: Unable to get property 'unpressed' of undefined or null reference This seems to be caused by a messing mesh for the controller. I thought it was just my project at first but I'm having the same problem in the Playground Example. The Playground example is found here (It is the official WebVR example from the dropdown menu): Can anyone confirm if they are having the same issue? The scene will load normally but if you press a button on the controller it freezes. Maybe some file is not accessible through the CDN. It worked fine for me previously. I am using Windows Mixed Reality through Microsoft Edge on windows build 1803. The problem occurs if I launch edge both through the desktop and inside the mixed reality portal. Thanks for any help! Edit: Note that the WMR controller mesh appears in the scene correctly. The crash happens when a button is pressed.
  20. Hi. I am visiting this forum a lot because i recently started working on several projects using babylon.js am absolutely in love with it. This is my first post/question ever tho and I hope you can help me. Also, I put "VirtualStoreProject" in the name because I believe I will have a few more questions during this so I want to I started working on Virtual Store project, and I created proof-of-concept page just to try some things out before going into the real work. Here is a link to that (looks awful at the moment I know) Now what I want to achieve is when I click on the mesh, that mash moves toward the center of the camera view. For now the implementation is not very fancy targetPosition = new BABYLON.Vector3(camera.position.x+20, camera.position.y, camera.position.z); and this only looks okay if you are looking straight at the mesh and you are not too close to a wall in front of you (in case you do, the mesh goes outside). Another question I want to ask is if there are some TriggerVolumes (as they are called in Unreal Engine 4) inside Babylon. So that i only can use some inputs and interact with meshes when I am inside that volume. I've kinda implemented this in the demo using the distance between the active camera and the hit after scene.pick() method. pickResult = scene.pick(scene.pointerX, scene.pointerY); currentMesh = pickResult.pickedMesh; if (!"env") && pickResult.distance < 80) but I am not sure if that is good solution for this project. Thank you all for the help. I hope you have a good day.
  21. I think I spot an issue when importing a gltf file containing instanced meshes. It simply seems to not instanciate meshes, but make copies instead. Here the gltf json showing meshes are correctly exported: and the result (playground link, check the console) same scene exported as .babylon is OK (playground link)
  22. In this playground, I see use of "createGUITexture" a lot, but when plug into my code, it seems createGUITexture is not a function... why? I've tried import * as BABYLON from 'babylonjs' import * as GUI from 'babylonjs-gui' import 'babylonjs-loaders' GUI.createGUITexture( ... ) BABYLON.createGUITexture( ... ) But it seems none of the namespace has this method...
  23. Not really sure whats going on here. Normally ArcCamera allows you to control the camera angle onPointerDown and releases its control onPointerUp. However, when I also modify a user interface onPointerDown, the ArcCamera control is locked, and isnt realsed until the interface is not visible (click button).
  24. What best way to create dynamic surface elevation? In my case, I want up/down elevations in one shown in the figure the elevation points in blue. This my starter case: Thanks
  25. So this kinda works.. Breaks as soon as you play with canvas or browser dimensions. Next tried to do some calculations following this StackOverflow post The PG is broken, canvas.getContext('2d') returns null. I suspect I will need to get the AdvancedTexture context, but not sure how. Than use it's currentTransform property to calculate the position. Open to ideas. Solved by Ssaket -