Search the Community

Showing results for tags 'babylonjs'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 235 results

  1. Hello, I have an .obj file and .mtl, when I try to run it the texture gets wrong, look at the images var canvas = document.querySelector("#renderCanvas"); // Load the BABYLON 3D engine var engine = new BABYLON.Engine(canvas, true); // ------------------------------------------------------------- // Here begins a function that we will 'call' just after it's built var createScene = function () { var scene = new BABYLON.Scene(engine); //Adding a light var light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene); //Adding an Arc Rotate Camera var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene); camera.wheelPrecision = 100.0; camera.attachControl(canvas, false); // The first parameter can be used to specify which mesh to import. Here we import all meshes BABYLON.SceneLoader.ImportMesh("", "js/novo/", "bg4_obj.obj", scene, function (newMeshes) { // Set the target of the camera to the first imported mesh // camera.maxZ = 100; camera.setPosition(new BABYLON.Vector3(30,30,30)); camera.target = newMeshes[0]; camera.wheelPrecision = 30; }); // Move the light with the camera scene.registerBeforeRender(function () { light.position = camera.position; }); return scene; } // ------------------------------------------------------------- // Now, call the createScene function that you just finished creating var scene = createScene(); // Register a render loop to repeatedly render the scene engine.runRenderLoop(function () { scene.render(); }); // Watch for browser/canvas resize events window.addEventListener("resize", function () { engine.resize(); }); bg4_obj.mtl bg4_obj.obj
  2. Can anybody explain me why we have babylon.worker.js? What is differecnce betwee babylon.js? Greetings Ian
  3. First release of full game Perplexus Shadow Open Where everybody could buil its own perplexus and upload and than everybody could play it (on all web browsers with webgl) Also on phones android and iphones Added Physics "Physics step" where 10 or 15 works as fast as 50 on desktop with nvidia 960 ... you can continue playing on check points on which you go through ... https://ajna4taiga.no-ip.org/PerplexusShadowOpen/PerplexusProd.html or update https://ajna4taiga.no-ip.org/PerplexusShadowOpen/Home.html I will release soon vidows how to build your own perplexus like lego ...and videos how to play each level from start to end.
  4. Hello, I have a scene and its zoom is very slow, how do I increase? (The zoom of the mouse scroll and the zoom with the fingers in the mobile) if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var newScene; BABYLON.SceneLoader.Load("", "js/teste.obj", engine, function (newScene) { newScene.executeWhenReady(function () { var camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0, 0, BABYLON.Vector3.Zero(), newScene); camera.setPosition(new BABYLON.Vector3(7500,7500,7500)); camera.attachControl(canvas, true); camera.maxZ = 0; camera.pinchPrecision = 30; newScene.activeCamera = camera; newScene.activeCamera.attachControl(canvas, true); newScene.clearColor = new BABYLON.Color3(0.5, 0.8, 0.5); engine.runRenderLoop(function() { newScene.render(); }); }); },function (progress) { }); } window.addEventListener("resize", function () { engine.resize(); });
  5. Ok I make two animation actions. ElevatorComponent1 (timeframe 0-240) ->Elevator1Action and ElevartorComponent2->Elevator2Action (timeframe 0-200). In Blender it looks fine/OK. Each elevator animate (loop animation of each object 1.ElevatorComponent1 and 2.ElevartorComponent2) Play look fine in blender. You can see it. (I attach blender file) I use only (Visual Location) for both animations. When I export from blender to .babylon. Exporter doesn't export as it should! Range and positions values are not OK !! WHY? IS THERE ANY BUG IN BLENDER->BABYLON EXPORTER ? (IS THERE ANY WAY TO MAKE FOR EACH OBJECT ITS OWN TIME_LINE FOR ANIMATION? HOW?) Can anybody take a look (ATTACHED FILE) and export it into babylon.js and see what is with range and positions values - is there bug??? Here is video https://www.dropbox.com/pri/get/Public/Screencast 2017-06-26 10%3A49%3A24.mp4?_subject_uid=20766916&w=AADvbTlbugqn3hWDvW0TvcKrFlvCsAGWkYMR1IlRIqyGdg (if I export to .babylon (ATTACHED FILE) file and put load it or put in sandbox it is confusion !! @gryff @JCPalmer @Deltakosh Maybe we can fix with editor inside babylon file. BUT IF I BUILD MODEL OVER AND OVER (WORKFLOW) THAN IF EXPORTER DOES NOT WORK OK. THAN THIS IS USELESS. Is possible to fix exporter? Greetings Ian ModelFInish_1.blend.zip ModelFInish.babylon
  6. Hi everyone, Has anyone written a babylonjs parser for blender or any other application like 3Ds Max or Sketchup. I was looking to convert a serialised file from babylonjs from our 3D BIM editor (https://youtu.be/BYRdX2SpQHw) into other file formats like .fbx or .obj etc. We are building a full fledged 3D BIM editor (http://snaptrude.com/demo) with babylonjs and would be needing a way to export the updated models out of our environment. I am interested to know if anyone in the community has already written it and willing to share to make the task easier for us and many others. However, if its not been done then we would have to build one on our own and will be willing to share it here :). Thanks in advance!
  7. Hello, I have a scene and it's disappearing, I do not know what it can be, I need help, sorry for my english I used google translate, See attached images, I also attached the 3d file, you can use it in the sandbox to see how it looks http://sandbox.babylonjs.com/ if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var newScene; BABYLON.SceneLoader.Load("", "js/teste.obj", engine, function (newScene) { newScene.executeWhenReady(function () { var camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0, 0, BABYLON.Vector3.Zero(), newScene); camera.setPosition(new BABYLON.Vector3(7000,7000,7000)); camera.attachControl(canvas, true); camera.lowerRadiusLimit = 10; camera.pinchPrecision = 30; newScene.activeCamera = camera; newScene.activeCamera.attachControl(canvas, true); newScene.clearColor = new BABYLON.Color3(0.5, 0.8, 0.5); engine.runRenderLoop(function() { newScene.render(); }); }); },function (progress) { }); } window.addEventListener("resize", function () { engine.resize(); }); teste.obj
  8. I am new to 3D game dev, and I'm wondering how to make a triangular prism that a sphere could roll down. I think I'm missing something huge, because physics libraries only seem to support the most basic geometries, excluding triangular prisms and other important shapes. Could someone please point me to some resources or explain how to deal with physical interactions between more complicated shapes? I notice that BabylonJS makes it easy to create lots of neat meshes, however, I'm missing how to simulate their shapes on the CannonJS side of things. I want to make a game where the player controls a sphere by rolling it around various scenes, but it just doesn't seem possible using only spheres and boxes, for example.
  9. I am struggling with a similar problem like in this thread, but the solution provided here seems not so ideal... I have many modules in my game, and if I use Babylon.js in any of those, I import it using: import Babylon from 'babylonjs' So there isn't any good way to include Canvas2D similarly? I understand it is somehow baked to Babylon.js, but how do I use it? I'm downloading all the dependencies from the npm, including Babylon.js. Then I bundle everything using Webpack. Ideally, I would like to use Canvas2D (for example) like this: import Babylon from 'babylonjs' import Canvas2D from 'babylonjs' Please help, I've been scratching my head for hours now...
  10. I have a large model exported from a software with a lot of nested instances. I added a shadow generator with defaults and added most meshes to its renderList. The console recommends to use Exponential Shadow Maps (ESM) which look also a lot nicer ("VSM are now replaced by ESM. Please use useExponentialShadowMap instead"). With ESM enabled, the scene turns mostly black because shadows are rendered also on top of those meshes that cast that part of the shadow. The issue only disappears when the shadow generator has only a single mesh in the renderList. See here: http://www.babylonjs-playground.com/#7CPG3X Is this a bug? Is ESM not yet stable (although the console recommends using it)? Is there a work-around? --- Another question: My model is mostly static. Are shadow maps regenerated at every frame or only when something (lights, meshes) changes?
  11. So I have forked and cloned babylon.js, added CreatePolygon to babylon.mesh.ts, babylon.mesh.vertexData.ts and babylon.meshBuilder.ts. Made a copy of this clone in a new folder (haven't fully got the hang of this branching thingy with git), done the Gulpy things and compiled to Javascript in the copy and the min file babylon.js seems to work OK with new functions. (will spend a bit more time fully testing tomorrow). Now a couple of questions as I am just blindly following contributing instructions and trying to convert my original Javascript code to acceptable typescript by reading the code that is already there.. 1. Some things like Box and Cylinder and Sphere appear in babylon.geometry.ts with a export class SHAPE extends _Primitive type whatsit. Do I need to make changes here as well? Not sure what the geometry bits are for. 2. Do I PR the version that I have not compiled from Typescript to Javascript or do I PR the compiled version. 3. ( A couple means 3 or 4 doesn't it). Does somebody check I haven't messed things up before the PR is accepted?
  12. I am am experienced developer but a newbie on BabylonJS. I tried to solve a simple problem on my own for the last 5 days and no matter how hard I try it still doesn't work. I am looking for someone who can do it for me, and I am more than happy to pay. So.. work for hire Job: - I have a 3d rigged hand model made in blender with animations through bones. I managed to export it but after doing so, even the mesh looks good the animations look bad. Instead of the hand opening and closing all mesh gets awkwardly deformed. It seems as if the deformers of the bones got all screwed up. I need someone to fix this and show me how can I move programmatically each of the phalanges of the fingers of the hand. Please reply if interested I will post more information as requested. Thanks a million! I have a really bad headache. I have been trying for days with no luck and I have decided this problem is way above my head. So.. please help. Happy to pay!
  13. In the process of building something with ThreeJS. When trying to find stock models for us with our WebVR project, most of them (especially office or apartment interior models - obj files) seem to be really huge and we do not want to use them for this web project. But, BabylonJS seems to have some demos which are rather rich, yet the model sizes are under 15MB mostly. Like this one for instance - http://www.babylonjs.com/demos/retail/ Absolute Newbie to webGL and 3D modeling in general. If we want an apartment or office interior model, and we want to optimize for file download size for our users via browser, what sort of formats should we look for and are there special settings that need to be made when designing the models themselves to yield them in a light weight manner for web use? Appreciate some gyaan here.
  14. Hello everybody :-) I'm trying to use ExtrudeShape for creating a building shape and am having trouble with the cap. I understand that the cap is not tessellated (triangulated) so it would be faster. But when I have concave angles in the shape, it doesn't look good. I also tried using Ribbon for the roof polygon somehow, but the tessellation doesn't happen here either of course. Here is my code: http://www.babylonjs-playground.com/#1KQZAF#0 I tried using PolygonMeshBuilder but the mesh is rotated the way I don't want it to and some walls keep dissapearing depending on the angle of view: http://www.babylonjs-playground.com/#SJLOW#1 I don't need the mesh to be updated so the speed of tessellation doesn't bother me much. What am I doing wrong? What can I do to have a tessellated building? Thanks :-)
  15. Hello again forum, i hope you have a nice day I would like to build a maze game, The maze will be generated on blender as .obj format. I know this is the code for intersect mesh for babylon mesh object, does blender use the same syntax as this ? Any advice or tips will be greatly appreciated, Thank you Cheers if (snake.intersectsMesh(box1, false)) { up = false; down = false; right = false; moving = false; }
  16. I have some model and when I would like to export it I get error Traceback (most recent call last): File " .config/blender/2.78/scripts/addons/babylon-js/__init__.py", line 84, in execute exporter.execute(context, self.filepath) File " .config/blender/2.78/scripts/addons/babylon-js/json_exporter.py", line 99, in execute mesh = Mesh(object, scene, nextStartFace, forcedParent, nameID, self) File " .config/blender/2.78/scripts/addons/babylon-js/mesh.py", line 148, in __init__ recipe = BakingRecipe(object) File " .config/blender/2.78/scripts/addons/babylon-js/material.py", line 190, in __init__ self.isBillboard = len(mesh.material_slots) == 1 and mesh.material_slots[0].material.game_settings.face_orientation == 'BILLBOARD' AttributeError: 'NoneType' object has no attribute 'game_settings' location: <unknown location>:-1 Can anybody help me? What could be wrong? Ian
  17. Greetings Again Forum, I hope you have a nice day I would like to ask whether babylon.js support backtracking function or not to find a shortest path to one mesh ? I would like the black box to follow the sonic character for more elaborate gameplay, does babylon js support this? Any advice or reply are greatly appreciated, cheers
  18. Hello, Islands of Tribes is a turn-based single-player and online multiplayer strategy game inspired by my favorite turn-based strategy game, Advance Wars, and a really cool RTS game, Tribal Trouble. The game is under active development, and new features will be added in updates. Main features: - Single player campaign - Custom games versus AI - Online multiplayer - Different tribes to select from with special abilities - Map editor - Buy new units from shop with gold you get by playing Free to play! Download for Android: https://play.google.com/store/apps/details?id=fi.matias.stoneage
  19. Greetings Forum, I hope you have a great day Today, I would like to ask how to randomize position in babylon.js. I have one Apple object which i would like to randomize its position everytime i touch it. Here's a screenshot of what my game looks like. As can be seen, I am trying to randomize the apple position to make it more like point collecting game. I'm trying to follow tutorial here But the program crashed, and wont work ... Any Attention or solutions will be greatly appreciated, cheers P.S : I tried to upload it to playground, but it seems not working because my apple and sonic are on different files, hence i can only provide a screenshot to help the forum to understand my question , I'm sorry for my lack of knowledge // Creation of Apple for(var i=0; i<20; i++) { x = randomNumber(-100, 100); z = randomNumber(-100, 100); var apple2; BABYLON.SceneLoader.ImportMesh("","Finalproject/", "apple.obj", scene, function (newMeshes, particleSystems, skeletons) { apple2 = newMeshes[0]; apple2.position.x = x; apple2.position.z = z; }); }
  20. Hello everyone, I am trying to export a scene as a babylonjs file; and I keep getting this error: ERROR: self.backFaceCulling &= material.game_settings.use_backface_culling ERROR: 'NoneType' object has no attribute 'game_settings'. I have unchecked culling for the mesh but it still shows the error. How would you go about this? Thank you for your time.
  21. Just ask. How is with engergy.js physics engine? Is it out our not ?? Can we try it? Any documentation? Or is it still not out? greetings
  22. Hello again forum, I hope you have a great day I would like to continue my snake project game, and today i have decided to make a scoreboard for each fruits eaten. However i have an issue, i cannot display a UI text on my project even though i have followed tutorial in here The program seems to crash too and wont run. Any help given is appreciated. Cheers Here's my code, i insert the URL code into createScene function. <!DOCTYPE html> <html> <head> <title>Snake Game</title> <script src="babylon.js"></script> <script src="hand-1.3.7.js"></script> <script src="babylonObjLoader.js" ></script> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <canvas id="mycanvas"></canvas> <script> var canvas = document.getElementById("mycanvas"); var engine = new BABYLON.Engine(canvas, true); var createScene = function() { var scene = new BABYLON.Scene(engine); var ground = BABYLON.Mesh.CreateGround("ground1", 100, 100, 100, scene); //var camera = new BABYLON.FreeCamera("camera2", new BABYLON.Vector3(0,5,-10), scene); /*var camera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 1, -15), scene); scene.activeCamera = camera;scene.activeCamera.attachControl(canvas); scene.activeCamera.keysUp.push(87); */ var camera = new BABYLON.ArcRotateCamera("camera",0,0,0,BABYLON.Vector3.Zero(0,10,0), scene); //var camera = new BABYLON.TouchCamera("camera2", new BABYLON.Vector3(0, 10, 0), scene); //var camera = new BABYLON.GamepadCamera("camera2", new BABYLON.Vector3(0, 15, -45), scene); //var camera = new BABYLON.DeviceOrientationCamera("camera", new BABYLON.Vector3(0, 1, -15), scene); //var camera = new BABYLON.FollowCamera("camera2", new BABYLON.Vector3(0, 15, -45), scene); //camera.lockedTarget = model; //camera.setPosition(new BABYLON.Vector3(0,5,-10)); camera.setTarget(BABYLON.Vector3.Zero(),scene); camera.attachControl(canvas,false); var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0,1,0), scene); light.intesity = 0.5; var body = BABYLON.MeshBuilder.CreatePolyhedron("body", {type: 10, size: 0.7},scene); var materialBody = new BABYLON.StandardMaterial("bodyMat",scene); materialBody.diffuseColor = new BABYLON.Color3(1,0,0); body.material = materialBody; body.position.y = 5; body.position.x = 50; body.rotation.x = Math.PI/4; body.rotation.z = .19; /*var head = BABYLON.Mesh.CreateBox("head",0.7,scene); var materialHead = new BABYLON.StandardMaterial("HeadMat",scene); materialHead.diffuseColor = new BABYLON.Color3(.5,.2,0.3); head.material = materialHead; head.position.x = -4.5; head.position.z = -3; head.position.y = 1; */ var canvas2 = new BABYLON.ScreenSpaceCanvas2D(scene, { id: "mycanvas", size: new BABYLON.Size(300, 100), backgroundFill: "#4040408F", backgroundRoundRadius: 50, children: [ new BABYLON.Text2D("Hello World!", { id: "text", marginAlignment: "h: center, v:center", fontName: "20pt Arial", }) ] }); var apple; BABYLON.SceneLoader.ImportMesh("","Finalproject/", "apple.obj", scene, function (meshes) { apple = meshes[0]; //apple.parent = sphere1; /*engine.runRenderLoop(function() { //scene.activeCamera.alpha += .01; apple.rotation.y +=0.1; scene.render(); }); */ }); var apple2; BABYLON.SceneLoader.ImportMesh("","Finalproject/", "apple.obj", scene, function (meshes) { apple2 = meshes[0]; apple2.position.x = 20; apple2.position.z = 20; }); /*var sphere1 = BABYLON.Mesh.CreateSphere("sphere1",1,1, scene); sphere1.position.y = 0.7; sphere1.material = myMaterial; var myMaterial = new BABYLON.StandardMaterial("myMaterial", scene); myMaterial.diffuseColor = new BABYLON.Color3(0, 1, 0); */ //sphere1.parent = apple; var snake ; BABYLON.SceneLoader.ImportMesh("","Finalproject/", "alphaSnake.babylon", scene, function (newMeshes, particleSystems, skeletons) { snake = newMeshes[0]; snake.position.y = 2; snake.rotation.z = -0.07; snake.rotation.y = 10; snake.rotation.x = 25; snake.position = new BABYLON.Vector3(10, 0, 0); //head.parent = snake; var isvisible = false; window.onkeyup = function(event) { event = event || window.event; var keyCode = event.which || event.keyCode; switch(keyCode) { // W key case 87: snake.rotation.y = Math.PI; snake.position.x -=3; //scene.beginAnimation(skeletons[0], 0, 60, true, 1.0); break; // A Key case 65: snake.rotation.y = Math.PI/2; snake.position.z -=3; //scene.beginAnimation(skeletons[0], 0, 60, true, 1.0); break; // S key case 83: snake.rotation.y = 25.5; snake.position.x +=3; //scene.beginAnimation(skeletons[0], 0, 60, true, 1.0); break; // D key case 68: snake.rotation.y = -Math.PI/2; snake.position.z +=3; //scene.beginAnimation(skeletons[0], 0, 60, true, 1.0); break; /*// E key case 69: if (snake.intersectsMesh(apple, false)) { isvisible = true; } break; */ // J key case 74: snake.rotation.y = Math.PI/2; break; // K key case 75: snake.rotation.y = 25.5; break; // L key case 76: snake.rotation.y = -Math.PI/2; break; // I key case 73: snake.rotation.y = Math.PI; break; } }; scene.registerBeforeRender(function(){ apple.rotation.y +=0.1; apple2.rotation.y +=0.1; if (snake.intersectsMesh(apple, false)) { apple.dispose(); } if (snake.intersectsMesh(apple2, false)) { apple2.dispose(); } /*if(isvisible == true) { apple.dispose(); } */ /*sphere1.scaling.x = 5; sphere1.scaling.y = 5; sphere1.scaling.z = 5; sphere1.position.y = 2.5; sphere1.material = myMaterial; apple.scaling.x = 0; apple.scaling.y = 0; apple.scaling.y = 0; */ }); }); return scene; }; var scene = createScene(); engine.runRenderLoop(function() { //scene.activeCamera.alpha += .01; /* if(isvisible == true) { sphere1.scaling.x = 0; } */ scene.render(); }); window.addEventListener("resize",function(){ engine.resize(); }); </script> </body> </html>
  23. Just a quick question; how to not freeze the render loop when doing "heavy" operations? Example: In my game, I have a stage that is composed of squares. The player can move around the stage but so can the enemies. The enemies are using a pathfinding system that uses navigation mesh. This navigation mesh is created dynamically when the game runs. Player can destroy the tiles of the stage. The tile destruction triggers the recalculation of the navmesh. The recalculation itself is a pretty heavy operation that freezes the whole game for a second or so. What I'm pretty much asking is if there is an async functionality for heavy functions/operations that are triggered from the render loop. Or what is the best way to handle these situations?
  24. Background: I am a newbie in game development I'm creating motion sensor game Air Table Tennis on Babylon.JS in which user can control the paddle of table tennis with his/her smartphone. I am using gyroscope/rotational data of mobile in the form of Quaternion to avoid Gimble Lock and sending the data to server(nodeJS). So Gyro data is coming from mobile through node JS. Problem: So, I am using Quaternion, But I am unable to map my paddle as my device. (paddle is not exactly in the position where my mobile is currently now, although moving on x,y,z axix give me correct result). So my question is how to calibrate/Map 3D object same as my mobile device? @[email protected]@Deltakosh Sir kindly help me, I'll be very thank ful. Thanks in Advance
  25. Hi, Have render a bike model as show. Few details regarding the model: Exported model from blender. All parts are under a parent mesh. I want to swap the existing fuel tank with a new fuel tank. Loading new mesh(fuel tank) using AssetsManager. meshTask.onSuccess = function (task) { //Get current tank //Hide current tank //Get current tank position using getAbsolutePosition() //Set position to new tank //Set new tank's parent //Show new tank } Few details regarding new tank model: Exported model from blender. Has no parent. But new tank is not in correct position. I can update the position manually(hard code) and get the following result.(Don't want to do this) Need to swap current mesh with new mesh and retain the position.