Search the Community
Showing results for tags 'babylon js'.
-
Hi I have just created a beginner's course on babylonJs on udemy named "Single & Multiplayer Game Development in Webgl's BabylonJs" I took permission from @Deltakosh to post the link on the forums Here you go ! https://www.udemy.com/single-multiplayer-game-development-in-webgls-babylonjs/?couponCode=BONUS10 Any comments are much appreciated, Thanks ! Ahmed
- 6 replies
-
- multiplayer
- udemy
-
(and 4 more)
Tagged with:
-
Hello, I'm trying to study babylon. Use "Making a Simple Driven Car" ( https://www.babylonjs-playground.com/#102TBD#33) and want to add some new functions for this. For example car track. This part of code is not working((( Can anybody give some idea to help me with this problem? I'm trying to change "width" parameter of "CreateBox" in the animation loop, but it's not working correctly( scene.registerAfterRender(function() { F = engine.getFps(); if(map[" "] && D < 15 ) { D += 1; }; if(D > 0.15) { D -= 0.15; } else { D = 0; } distance = D/F; psi = D/(r * F); if((map["a"] || map["A"]) && -Math.PI/6 < theta) { deltaTheta = -Math.PI/252; theta += deltaTheta; pivotFI.rotate(BABYLON.Axis.Y, deltaTheta, BABYLON.Space.LOCAL); pivotFO.rotate(BABYLON.Axis.Y, deltaTheta, BABYLON.Space.LOCAL); if(Math.abs(theta) > 0.00000001) { NR = A/2 +L/Math.tan(theta); } else { theta = 0; NR = 0; } pivot.translate(BABYLON.Axis.Z, NR - R, BABYLON.Space.LOCAL); tractorBody.translate(BABYLON.Axis.Z, R - NR, BABYLON.Space.LOCAL); R = NR; }; if((map["d"] || map["D"]) && theta < Math.PI/6) { deltaTheta = Math.PI/252; theta += deltaTheta; pivotFI.rotate(BABYLON.Axis.Y, deltaTheta, BABYLON.Space.LOCAL); pivotFO.rotate(BABYLON.Axis.Y, deltaTheta, BABYLON.Space.LOCAL); if(Math.abs(theta) > 0.00000001) { NR = A/2 +L/Math.tan(theta); } else { theta = 0; NR = 0; } pivot.translate(BABYLON.Axis.Z, NR - R, BABYLON.Space.LOCAL); tractorBody.translate(BABYLON.Axis.Z, R - NR, BABYLON.Space.LOCAL); R = NR; }; if(D > 0) { phi = D/(R * F); if(Math.abs(theta) > 0) { pivot.rotate(BABYLON.Axis.Y, phi, BABYLON.Space.WORLD); psiRI = D/(r * F); psiRO = D * (R + A)/(r * F); psiFI = D * Math.sqrt(R * R + L * L)/(r * F); psiFO = D * Math.sqrt((R + A) * (R + A) + L * L)/(r * F); wheelFI.rotate(BABYLON.Axis.Y, psiFI, BABYLON.Space.LOCAL); wheelFO.rotate(BABYLON.Axis.Y, psiFO, BABYLON.Space.LOCAL); wheelRI.rotate(BABYLON.Axis.Y, psiRI, BABYLON.Space.LOCAL); wheelRO.rotate(BABYLON.Axis.Y, psiRO, BABYLON.Space.LOCAL); } else { pivot.translate(BABYLON.Axis.X, -distance, BABYLON.Space.LOCAL); wheelFI.rotate(BABYLON.Axis.Y, psi, BABYLON.Space.LOCAL); wheelFO.rotate(BABYLON.Axis.Y, psi, BABYLON.Space.LOCAL); wheelRI.rotate(BABYLON.Axis.Y, psi, BABYLON.Space.LOCAL); wheelRO.rotate(BABYLON.Axis.Y, psi, BABYLON.Space.LOCAL); } //create tractor track var trailer_track = BABYLON.MeshBuilder.CreateBox("trailer", {height: 0.1, width: (D+D_prev), depth: 15}, scene); //trailer_track.width += D; //trailer_track.translate(BABYLON.Axis.X, -distance, BABYLON.Space.LOCAL) //trailer_track.parent = trailer; var trailerTrackMaterial = new BABYLON.StandardMaterial("trailer_mat", scene); trailerTrackMaterial.diffuseColor = new BABYLON.Color3(1, 1, 0); trailerTrackMaterial.alpha = 0.01; trailer_track.material = trailerTrackMaterial; trailer_track.position.y = -2.5; } D_prev = D; });
-
I NEED HELP IN Clock time Function in babylon js 3d configurator th i want to make this model watch hands Movie like Real clock and real time any one can help me i have use this code for run that functions var hrHand = document.getElementById('hrHand'); var mnHand = document.getElementById('mnHand'); var mnHand = document.getElementById('secHand'); function initClock() { var date = new Date(); var hour = date.getHours() % 12; var minute = date.getMinutes() ; var second = date.getSeconds() ; var hrDeg = 0; var mnDeg = 0; var secDeg = second * 6; hrHand.transform = 'rotate(' + hrDeg + 'deg)'; mnHand.transform = 'rotate(' + mnDeg + 'deg)'; mnHand.transform = 'rotate(' + secDeg + 'deg)'; setTimeout(initClock, 1000); }; initClock(); and my object Id is this i try all js code of clock not working any one Please help me out any one can send me the demo of clock function ?
-
Hi all, We have a web based 3d project to be made with babylon. all models and baked diffuse textures will be provided, FBX and jpg textures, what you need to do is : 1-import assets, create PBR surface shader for building and a reflective transparent glass shader for windows 2- a directional light with shadow 3-implement a navigation system with left click hold to rotate around model, middle click pan , and right click hold to to zoom in and out 4- ability to double click and move camera to teleport on any point on the model to explore up close. 5- UI system with dimension and text where you double click on the UI you zoom on it. 6- Button to toggle UI on and off 7- full screen button This whole system is already implemented with unity and its live on following link you can see what exactly we need to make. What we need is this to be made with native WebGl using Babylon js or 3 js so all browsers on mobile,Mac and PC could open it, this is critical for this project. we want the exact look and feel. http://www.v2igroup.com/edq/ I reckon we can do this hourly based AUD, payment will be via paypal. we will be having 7 of this all the same only buildings type change, so first one would require more work the rest would be just replacing and adjusting the buildings and context. please let me know if you have enough experience to take on this task. EMAIL [email protected] yours, Sam
- 3 replies
-
- webgl
- babylon js
-
(and 2 more)
Tagged with:
-
i'm trying to create a simple game using babylon but stuck at a point where i need to detect * the mesh(s) that is directly below a mesh that is being dragged example - different food articles need to be placed on different types of plates let's say an ice-cream scoop is being dragged(pointermove event) on any of the plates which are close to each other after someone places a scoop on a particular plate (pointerup event) how to know which mesh or meshes is below that? a lengthy way is to loop through position of each mesh of plates(which are around 80 in number) with position of latest dragged mesh(ice cream scoop in this case) and find the right one above which ice cream is. is there any other efficient method?
- 8 replies
-
- babylon js
- babylonjs
-
(and 1 more)
Tagged with:
-
Hello Everyone, I've just started to use Babylon.js for the the purpose of posting 3d content to Facebook. I am trying to post a scene that consists of a 3d model and an environment from a 360 degree image. How do I export my environment ? all my attempts ( Creating default skybox, a sphere with flipped normal, ...) have been met with failure: - In case of exporting the environment map no success. - In case of flipped sphere, it always views the scene from outside rather from inside. Any solutions? I am trying to refer to the documentation but no clear answer so far. Thanks
- 3 replies
-
- 3dsmax
- babylon js
-
(and 6 more)
Tagged with:
-
Hi, I am simply trying to arrange items in a box (kind of like a shopping bag) however I am unable to "detect" collision correctly. In the example I created, I have two simple cylinders in a box; but the cylinders collide till the half of their radius. Also once they collide with the container (box) ... also half; you can never drag them back http://playground.babylonjs.com/#8CDJXW Could you please advice what I am doing wrong. Thanks, Dhiru
- 20 replies
-
- babylon js
- movewithcollisions
-
(and 1 more)
Tagged with:
-
Hi everyone, I need your help a new time... I updated my BabylonJs version from 2.2 to 3.1.1 and I have a problem with an import skeleton : here the code (from the doc) calls which is very simple : function importSquelette(nomSkelAtelier, chemVersFichierSkelAtelier, nomFichierSkelAtelier, laScene) { BABYLON.SceneLoader.ImportMesh(nomSkelAtelier, chemVersFichierSkelAtelier, nomFichierSkelAtelier, laScene, function (newMeshesSkel, particleSystems, skeletons) { var dude = newMeshesSkel[0]; //dude.rotation.y = Math.PI; dude.position = new BABYLON.Vector3(0, 0, 10); } ); } parameters values : - nomSkelAtelier = 'Armature_Striker_AZ_9' - chemVersFichierSkelAtelier = '../Scripts/Bll_IFC/Mesh/MeshSkelette/' - nomFichierSkelAtelier = 'Striker_AZ_9.babylon' - lascene = the scene loaded before I specify that : - the scene.babylon file and the skeleton.babylon file aren't in the same folder. - the exporter for Blender was the version 5.5 - the version of Blender is 2.79 And here the consol log when i click to the button which call the import skeleton function: How can I fix it ? I try to finish a game fight robot and import skeleton is the main part of the game .... Thanks !
- 10 replies
-
hi everyone,I want to get x and y from ground when I click and where I click to do click to move. I tried this but it not working to me: P.S scene.meshes[1] is a ground var pickInfo = scene.meshes[1].pick(ev.clientX,ev.clientY); error: Object doesn't support property or method 'pick'
- 4 replies
-
- click to move
- babylon js
-
(and 2 more)
Tagged with:
-
Hey guys, Love babylonjs, been using it to create arch-viz products and it's great. My questions is: I'm exporting from 3dsmax a scene that contains 4 specific house models each with specific materials, then I instanced the houses all over the map and changed the material on specific houses according to their location relative to my sunlight(directional light). I did this so that I could use different ambient maps for the different houses. My issue is that all the instances are exported with the same material even though some have a different material, example ; I want the mesh for House-South-1 to have material of House-South-1, and House-North-1 to have material House-North-1, but all the instances of the mesh are exported with the same material. Thanks,
-
Hello Everyone, I am seeing an error in chrome debug panel which says "Uncaught SyntaxError: Unexpected end of JSON input error on browser tool " I have also attached the screenshot of the error. I am using Babylon .5.4 exporter with the latest version of Babylon js on 2.78a blender. I am using screenimportmesh and asset manager to load 2 of my Babylon file. But Asset manager is failing to achieve onsuccess event. so scene is not rendering, But if i am calling render scene on assetmanager onerror scene is rendering which is a bit confusing, why The asset manager calling error when it is able to load models. For reproducing the issue : Reload the below link for 2nd time ,it will regenerate syntax error on browser debugger. https://s3.amazonaws.com/sudha.xyz/buggy/screen.html Reproducing scene not rendering problem : remove below code from line number 111(visual studio code) run(gamescene); This function is calling my scene rendering. But it should be fire up from mesh load onsuccess .if it is firing up from onerror . if i remove calling the above function from error call scene will never load I think it is linked to the Uncaught SyntaxError: Unexpected end of JSON input error on browser tool error. Kindly help me with this bug . please note: There are some other errors for manifest and one of startup function which I am aware of, and as much as I know manifest are not really responsible for this issue Thank you
- 2 replies
-
- unexpected end of json
- blender
-
(and 1 more)
Tagged with:
-
If we can, please explain with some steps! Thanks!
-
Hi! I am a newbie to babylon js, and I already have problems. I have loaded textures to my object (stick/bar) and problem is when I resize my object, texture resizes too. I tried to apply texture after scaling object, but texture resizes anyway. I really don't want to create a new texture for every object just because its size changes. So, my questions are: Is there a way in babylon js to set its size to be fixed? Or is there a way to set texture to repeat itself rather than scale itself to wrap the object. Image is attached (mind the upper bar is longer and its texture is scaled <-- that's my problem).
- 27 replies
-
I am a newbie -- wanted to know how I can create a transparent cube that can contain other objects that are within it which are visible (kind of like hidden but visible objects) Could you please advise what I should be trying to create/search.
-
Hi, I have created the object on Babylon Js and can able to rotate and view the object using arc rotate camera. My requirement is: 1. I positioned the camera on some position. 2. When the user click and move the mouse on canvas, can able to rotate the object. I have done the above things Whenever the user release the mouse on canvas while rotating, the camera back to the default position of initial stage.----> This is my requirement. Can anyone help on this?
-
Hi, I have created the object on Babylon Js and can able to rotate and view the object using arc rotate camera. My requirement is: 1. I positioned the camera on some position. 2. When the user click and move the mouse on canvas, can able to rotate the object. I have done the above things Whenever the user release the mouse on canvas while rotating, the camera back to the default position of initial stage.----> This is my requirement. Can anyone help on this?
- 5 replies
-
- arcrotatecamera
- camera
-
(and 3 more)
Tagged with:
-
Hi all I'm trying to make an animation play when i hit a button so far I've tried using an onclick attribute on the button tag but it didn't work and nothing on the forums looks like it would help. I'm trying to make it a bit like jigspace if that helps. }); project.js
- 5 replies
-
- javascript
- babylon js
-
(and 1 more)
Tagged with:
-
Hi Guys! So i'm starting with babylon a few days ago, so I have one doubt and I don't know how to do it right, so my question is. I have sphere1.position.x = 20; and sphere2.position.y = 30; , and I want create a cylinder that goes to sphere1 position.x to sphere2,position.y, How can I do that? Is it possible ? Something like the photo below. Plz! If someone know how to do it, plz! send a tutorial link
-
Frist- Hi evryone, i'm newbie on Babylon Js. Second - i'm lookin for similar args , with no goal. - - sorry if alredy exist one Problem I'm looking for method to select all surface facets (basically I select the entire surface) My idea is: R1: "Facets with two vertices equal are contiguous" ( evaluate a set of coordinates) R2: "Valuate the same oriented 'Normal' facets " Evaluate true of R1 && R2, made well done job? Thanks 4 help
- 6 replies
-
- babylon js
- face
-
(and 2 more)
Tagged with:
-
Hi, babylon js developers! Please help me :). I want to detect particle collision with camera elipsoid, and when particle will collide - destroy this particle. Can i make this in particle system update function or how? Babylon js can make this for me?
- 3 replies
-
- babylon js
- collision
-
(and 3 more)
Tagged with:
-
Hello, I am applying texture using my own uv2. This is the texture applied on a sphere (normal map): And this is the texture: So my problem is that on border of each parts there are seams due to the interpolation between one texel colored and another one at Color4(0,0,0,0). This is causing void then black till the right one value. I could expand the border of one texel (dilatation) to fix that but this is increasing padding in my texture... So first I would like to know if there is another way to cancel this interpolation. Thanks !
-
Hi everyone, I have a big problem... I see when I execute my game with basic animations, some objetcs have location change...I had understood than the problem is the Babylon's exporter 4.6.1 merge animations objects like in this example : After creation animations in Blender : After export with Babylon Exporter : I saw this topc but I don't understand if there is a solution or not ... Anybody can explain me how can I resolve this problem ? Use previous release of Babylon Js or Blender ?? Thanks!
-
Hey people I'm new to the board and I wanted some help with an experiment I did. So, I wanted to see if the fur simulator worked well with cutom 3d models, so I exported a 3d model from a game. In this case I was testing with Donkey Kong. now, I have exported it in .babylon and it seems to work with sandbox. I downloaded the fur plgin and copied the debug layer to test, and after doing some tweaking I uploaded it to let the .babylon model load. After doing that I got http://goo.gl/fjm6w9 in the JS debug window I got an error saying "cannot set property material of undefined." dont bother the XML request error. Can anybody please help me?
-
Hey guys! thanks for all the answers in the other topic, those helped me a lot ;). I have a doubt, how can I set a min angle and max angle for my camera rotation? because I don't want my camera to rotate 360° . What I tried is to let a little box to follow the camera and it has a collision with some walls in order to stop showing the part I don't want to. it worked but the effects are really ugly. That's is solution, as I mentioned It's has some ugly effects and is not always exact. var prevTarget= jQuery.extend(true, {}, camera.getTarget()); //OP1 scene.registerBeforeRender(function () { for(var i in objs)//the walls I mentioned if (objs[i].intersectsMesh(sphere, true) && scene.isReady()) camera.setTarget(prevTarget); prevTarget= jQuery.extend(true, {}, camera.getTarget()); }); //or //OP2 (more precise) setInterval(function(){ for(var i in objs) //the walls I mentioned if (objs[i].intersectsMesh(sphere, true) && scene.isReady()) camera.setTarget(prevTarget); prevTarget= jQuery.extend(true, {}, camera.rotation); },0.1); I hope a better way to do it, thanks guys for supporting us
-
I follow a Microsoft tutorial to show a scene that I exported from 3ds Max. The tutorial link is: https://blogs.msdn.microsoft.com/eternalcoding/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender/ The Babylon scene can be seen on the Sandbox, but not offline. Here is my page code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Using babylon.js - How to load a scene</title> <script src="babylon.js"></script> <script src="hand.js"></script> <script src="cannon.js"></script> <!-- optional physics engine --> <script src="oimo.js"></script> <style> html, body { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden; } #renderCanvas { width: 100%; height: 100%; } </style> </head> <body> <canvas id="renderCanvas"></canvas> <script> if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "TestExportFrom3dsMax.babylon", engine, function (newScene) { // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { // Attach camera to canvas inputs newScene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { newScene.render(); }); }); }, function (progress) { // To do: give progress feedback to user }); } </script> </body> </html> How to show the Babylon scene on web browser offline?
- 3 replies
-
- babylon js
- scene
-
(and 3 more)
Tagged with: