Search the Community

Showing results for tags 'babylon'.

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
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • 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 391 results

  1. Hi, I'm CDN'ing in Babylon 2.4 and I'm wanting to know about pep Do i need to include jquery before i include pep in order for it to be useful like the pep docs say i should ? Thanks.
  2. Hi, I use new version of Blender(2.78a) and I have my model in it, so I tried to export it to .babylon file. I got exporter file from Github just now and I have already move to Blender's addons. When I tried to export my model it got this error(in the picture that I have attached), but when I tried to export a normal cube, I could do it. With the same model, I can do it with the babylon exporter that come with babylon v2.4 and previous version of Blender. But for both new version of Blender and Babylon i can't. Thank you in advance Peace
  3. Hi there, I'm trying to get a simple animation exported into Babylon. However, I've run into a problem. Here is a link to how the animation looks in 3ds max. Looks correct. Here is a link to what the animation looks like in Babylon. Look to the right to see the rover. It's firing out its wheels!! The animation keys were added directly to the bones. (I'm not sure if that's relevant or not.) Also as a sidenote, I've tried the Unity 5 exporter. It also does not export animations correctly. Any clue as to what's happening?? What steps can I take to make sure my animations come out correctly? Thanks!
  4. Hi, I wonder if it's possible at all to pre-bake shadows at runtime? I've got a scene that is generated by users. Position of items is thus unknown. I'd like to cast shadows from these items, but it's too costly CPU-wise. It would be really cool if one was able to run something like BABYLON.bakeGroundShadows(objectsList) which would create texture on the fly for the ground mesh (I'm aware that baking and creating textures for all meshes can max out GPU memory).
  5. Hi, Is there a built in way to "lookAt" a point in 3D space, using only 2 coordinates( x and y ). I found a lookAt function from this forum, but that used 3 coordinates which screws up the camera and player orientation. Id like to keep my player's z rotation always at 0.
  6. Hi everybody, I am very new to both Blender and Babylon. Basically I am trying to load a scene exported from Blender and create a skybox afterward, the scene is nothing more than a default blender scene(the one consists of a box, camera and light, I load this scene just to make sure I hadn't added or modified anything in the scene that may leads to other issues once I export the scene into babylon file). I try to create a skybox after loading the scene, using code below: =============================================== var canvas; var engine; var scene; function initScene() { canvas = document.getElementById("renderCanvas"); engine = new BABYLON.Engine(canvas, true); scene = new BABYLON.Scene(engine); BABYLON.SceneLoader.Load("babylon/","testScene.babylon",engine,function(newScene){ newScene.executeWhenReady(function(){ newScene.activeCamera.attachControl(canvas,false); var ground = BABYLON.Mesh.CreateGround("ground", 10, 10, 2, newScene); var skybox = BABYLON.Mesh.CreateBox("skyBox",1000.0,newScene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox",newScene); skyboxMaterial.backFaceCulling = false; skybox.infiniteDistance = true; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("images/skybox/cloudSkyBox/DaySkybox", newScene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.disableLighting = true; skybox.material = skyboxMaterial; engine.runRenderLoop(function(){ newScene.render(); }); }); },function(progress){}); } function initBB(){ if (BABYLON.Engine.isSupported()){ initScene(); }else{ console.log("not support BB"); } } document.addEventListener("DOMContentLoaded",initBB,false); document.addEventListener("resize",function(){ engine.resize(); }); =============================================== The blender scene "newScene" is loaded(I can see the box, a directional light of the blender default scene, I can use the free camera preset in blender scene), the ground mesh added into the newScene can be seen as well, but the skybox is not shown! There is no error message shown on the browser console, I had tried to google for similar problem but couldn't find the solution... I am not sure if I set up the blender scene wrongly before I export or there is other factor that cause this issue. Any help would be greatly appreciated!
  7. Hi I'm starting to love programming in Babylon.js but I do not know how to do it. I am modeling a scene created 3D Max, exported Babylon.js (save this page). I leave several files but do not know how to take each scene objects and encourage them to coordinate parameters to then play one or the other animation as I want. I know it can be done by planning everything from the beginning but I want to take some objects made in 3D Max, put the mechanism progragramació and render it in the browser.
  8. I see a framerate drop in the latest 2.5 compared to 2.4. It's not huge: about 5-6 FPS, but still noticeable.
  9. Hi, Another head scratcher for me: I'm trying to cast rays to detect if an a object (A) is in "view" of another object (B). B has got lookAt(A) attached to it, so this is how I'm constructing the ray: var ray = new BABYLON.Ray(this.mesh.position, this.mesh.rotationQuaternion.toEulerAngles().normalize()); It's not working, so what am I doing wrong?
  10. Hi, Is there a way to extract a bone's World position? I need an actor to pick up a rock and throw it. ELI5, please!
  11. Is there any comprehensive es6 boilerplate for Babylon? For Phaser is a lot, but for Babylon I haven't found yet. If somebody has done some kind of boilerplate, could I get it also?
  12. Hey guys, I've a problem with the FbxExporter. Every time I export my model I only got the model without textures(only 2 textures, the texture of the roof and the wood texture) and if I try the model in the Sandbox it has only 5 -15 fps but I exported with 60 fps. Please help! ;( ~ Marc
  13. There is some issue when export 3DMax format file to .babylon. blow is my 3DMax file.
  14. Hi, I use scaling to make my gameobject "grow bigger", however i noticed it's having an unusual/weird effect on the camera that is a "child" of that object. ( camera.parent = my_gameobject) Basically objects will disappear into blind spots that appear. If scaling is very low, then everything disappears. I also noticed that scaling effects players position/translations even though it shouldnt( i think ). For example if i scale down my object 5 times, then it seems to move/traverse 5 times slower. What other effects does scaling have on a mesh/its children aside of scaling its geometry. Also how do i scale without messing up the camera, or what changes do i need to apply on camera to undo the scaling on its parent ?
  15. How can i do the babylon libary autocompletion for sublime text? ive looked eveywhere on forums but i cant find it. it will really help me when im programming. if not sublime text how can i do it for any text editor? is there is step by step guide? please help
  16. Hi everyone, A bit of a babylon philosophical question here. I want to deal with a massive amount of spheres, and want to keep it as smooth as possible. I thought I would hide spheres which are no longer in the view frustum. Now that I got that code, I wonder what is the most efficient, either to hide the meshes by selecting and applying .visibility = 0, or if it is better to dispose of the meshes ? If you're curious, in my case I only rotate the camera and don't move it, and I know what I have to show thanks to the angles within a database. Currently, Babylon still feels a bit too slow to my taste with many elements hidden. Should I change my code to dispose of the meshes and recreate them instead of hiding/showing ? Best, Kevin
  17. Hi, Im looking for a way to place objects relatively to other nested objects. ( objects that have a chain of parents that have been moved, rotated ). I searched the docs but couldnt find anything that could do what im looking for. Ive tried position.add / addToRef etc but they dont take object's rotation/parent chain into account. An example of what id like to do: A player turns 90 degrees in x direction. A weapon that is parented to the player, turns another "n" degrees. Now, how would i put a bullet at the tip of the weapon. ( without setting its parent = weapon ). After the bullet is created, it would move/follow objects in global space/coordinate system. in pseudo code: bullet = new Bullet();//extends Mesh. bullet.position = player.weapon.position.clone().translate(BABYLON.Axis.Z, weapon_barrel_length, BABYLON.Space.LOCAL); Note: position object doesn't have translate function, only mesh. My actual case is a bit different but this example explains it better.
  18. Hi, I created a mesh using CreateLines function. The function works as it should, but the lines are drawn white. I tried giving it a material, but it throws an error, telling me there is no setter. I tried modifying using mesh.material.setColor3 and 4 and other properties, but they had no effect. How can i change the color of the lines. And also give the lines some shading, just like wireframe materials do. PS: i cant use regular mesh with wireframe material because it creates triangles and adds extra lines. E.g if i draw a square face, then wireframe view shows diagonals too.( like 2 triangles )
  19. Hi, Im relatively new to babylon, and i find its animation's api somewhat confusing. Atm, my problem is making a game object jump forward. I managed to do that, but the animation is applied to the object's position coordinates in using world orientation. If my game object rotates e.g 90 degrees, then the jump will be animated sideways, not forward. How can i tell the animation api to use local coordinates(translate property value ).
  20. Hello! In begin I want to apologize for my English. I am using mesh.attachToBone for mount my pistol with character hand. All works fine. But when I am using bone.updateMatrix for rotate character torso var mat = this.torso.getLocalMatrix(); mat = mat.multiply(BABYLON.Matrix.RotationX(r)); this.torso.updateMatrix(mat); Torso rotates correctly, but my pistol still in place. On left screen you can see how work pistol.attachToBone, on right screen it is when I am changed torso rotation, but pistol did not move.
  21. Hello! I have a problem with parent mesh rotation. Scene has two objects which will be rotation around center of bottom object. If bottom object placed on scene center then objects rotation correctly. But if replace bottom object then stranges begin... I create parrent mesh for object and try to rotate it. Please tell me where I wrong?
  22. I have 2 questions regarding loading meshes from a .babylon file: 1) I'm loading the .babylon file through the AssetsManager. Textures related to the meshes that are specified in that file are being loaded as well. Are these textures loaded right away or are they loaded only once the mesh is created? I'm preloading all assets and displaying a loading bar before the game is shown. I'd like to know if these textures will be loaded with all assets in the preloading time, or am I to expect extra loading time of these textures after preloading is over? 2) File names including paths of textures related to meshes must be specified in their designated "name" parameter in the .babylon file. It makes sense. I'd like however to create a folder per .babylon file, with the .babylon file and all its textures in that folder. Therefore, I'd like the textures specified in the babylon files to only include the name of the texture file, and adjust the path prefix at runtime according to the .babylon file path. For example, let's say I have the babylon file assets/meshes/meshName/data.babylon, and a texture specified in it is located in assets/meshes/meshName/. I'd like to specify in the texture's name parameter only "textureName.png" instead of "assets/meshes/meshName/textureName.png" and to add the path prefix "assets/meshes/meshName/" which will be derived from the path of the .babylon file at runtime. Is that possible? How should I approach this problem? I'd like to avoid having to manually edit paths in every .babylon file since I'm likely to be facing hundreds of those. I can also think of a dozen ways to modify the .babylon file's actual content before it is even loaded, but I'd like to avoid these as well for the sake of a "prettier solution to the problem".
  23. I have two images loaded. Once is scodix.jpg which is a regular jpg image and on top of that i have a scodix.png that is a transparent image with only a small part that has artwork. What im trying to accomplish is to have a light shining on the transparent image but only showing the actual image to have the light and shadow affect. below is the code i have but when the light shines its shining on the entire thing including the non transparent part or jpg part. Im trying to accomplish a scene where a user can rotate the image and the lighting will continue to follow the transparent image and possibly show a shadow. Can anyone help? var createScene = function () { var scene = new BABYLON.Scene(engine); //Create a light var light = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene); //Create an Arc Rotate Camera - aimed negative z this time var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, 1.0, 210, BABYLON.Vector3.Zero(), scene, true); camera.attachControl(canvas, true); //Creation of a repeated textured material var materialPlane = new BABYLON.StandardMaterial("texturePlane", scene); materialPlane.emissiveTexture = new BABYLON.Texture("images/scodix.jpg", scene); //materialPlane.emissiveTexture = new BABYLON.Texture('images/scodix1.png', scene); //materialPlane.useAlphaFromDiffuseTexture materialPlane.specularColor = new BABYLON.Color3(0, 0, 0); materialPlane.backFaceCulling = true;//Allways show the front and the back of an element materialPlane.emissiveTexture.level = 1; //It is kind of z-index var spotPlain = new BABYLON.StandardMaterial("texture", scene, true); spotPlain.diffuseTexture = new BABYLON.Texture("images/scodix.png", scene); spotPlain.anisotropicFilteringLevel = 0; spotPlain.diffuseTexture.hasAlpha = true; spotPlain.useAlphaFromDiffuseTexture; spotPlain.hasAlpha = true; spotPlain.specularColor = new BABYLON.Color3(0, 0, 0); spotPlain.backFaceCulling = true;//Allways show the front and the back of an element //Creation of a plane var plane = BABYLON.MeshBuilder.CreatePlane("plane", {width: 261, height: 153}, scene, true, BABYLON.MeshBuilder.FRONTSIDE); plane.material = materialPlane; var plane2 = BABYLON.MeshBuilder.CreatePlane("plane2", {width: 261, height: 153}, scene, true, BABYLON.MeshBuilder.FRONTSIDE); plane2.material = spotPlain;; return scene; };
  24. Hello I am trying to develop a FPS using BabylonJS and CannonJS in TypeScript. My first problem was what type of Impostor to use as the player, end up using a Cylinder with a FixedRotation = true. Now I place the camera on top off the Cylinder on every frame, and apply Impulses to the Cylinder based on keyboard input, and camera target. The algorithm that I came up is the flowing (hero = Cylinder): scene.registerBeforeRender(function () { //Your code here //Step camera.position.x = hero.position.x; camera.position.y = hero.position.y + 1.0; camera.position.z = hero.position.z; let camFront = camera.getFrontPosition(1.0); let vecFront = camFront.subtract(camera.position); vecFront.normalize(); let finalVector = new BABYLON.Vector3(0.0, 0.0, 0.0); if (moveForward) { finalVector = finalVector.add(new BABYLON.Vector3(1.0 * vecFront.x, 0.0, 1.0 * vecFront.z)); } if (moveBackward) { finalVector = finalVector.add(new BABYLON.Vector3(-1.0 * vecFront.x, 0.0, -1.0 * vecFront.z)); } if (moveRight) { let q = BABYLON.Quaternion.RotationAxis(BABYLON.Axis.Y, BABYLON.Tools.ToRadians(90)); let m = new BABYLON.Matrix(); q.toRotationMatrix(m); let vecRight = BABYLON.Vector3.TransformCoordinates(vecFront, m); vecRight.normalize(); finalVector = finalVector.add(new BABYLON.Vector3(1.0 * vecRight.x, 0.0, 1.0 * vecRight.z)); } if (moveLeft) { let q = BABYLON.Quaternion.RotationAxis(BABYLON.Axis.Y, BABYLON.Tools.ToRadians(-90)); let m = new BABYLON.Matrix(); q.toRotationMatrix(m); let vecLeft = BABYLON.Vector3.TransformCoordinates(vecFront, m); vecLeft.normalize(); finalVector = finalVector.add(new BABYLON.Vector3(1.0 * vecLeft.x, 0.0, 1.0 * vecLeft.z)); } finalVector = finalVector.normalize(); hero.physicsImpostor.applyImpulse(new BABYLON.Vector3(15.0 * finalVector.x, 0.0, 15.0 * finalVector.z), hero.getAbsolutePosition()); }); Is there a more effective way to do this ? Thanks in advance.
  25. Hello all I have a weird scenario where i am stuck. I currently have 2 images that are used as textrue and i load both onto 2 planes where they show on the same side. Now i need to kind of show 2 different planes or a double sided plane where each side has its own image or texture. Please look at the code that i have. For some reason the plane and plane2 show fine but plan3 and plane4 do not show up var scene = new BABYLON.Scene(engine); //Create an Arc Rotate Camera - aimed negative z this time var camera = new BABYLON.ArcRotateCamera("Camera", -2.5, 1.2, 350, BABYLON.Vector3.Zero(), scene, true); camera.attachControl(canvas, true); //Create a light var light = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene); var spot = new BABYLON.SpotLight("spot", new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(0, 0, 1), 0.8, 2, scene); spot.diffuse = new BABYLON.Color3(1, 1, 1); spot.specular = new BABYLON.Color3(1, 1, 1); spot.intensity = 1; spot.position = new BABYLON.Vector3(0, 0, -500); // spot.setDirectionToTarget(new BABYLON.Vector3(0, 0, 0)); spotcone = BABYLON.Mesh.CreateCylinder("cone", 16, 12, 0, 8, 0, scene); var conemat = new BABYLON.StandardMaterial("cone", scene); conemat.diffuseColor = new BABYLON.Color3(0, 0, 2); spotcone.rotation.x = Math.PI/2; spotcone.bakeCurrentTransformIntoVertices(); spotcone.material = conemat; spotcone.parent = spot; var sURL = "images/scodix1.jpg"; var materialPlane = new BABYLON.StandardMaterial("solid", scene); materialPlane.diffuseTexture = new BABYLON.Texture(sURL, scene); // materialPlane.emissiveTexture = new BABYLON.Texture(sURL, scene); //materialPlane.emissiveTexture = new BABYLON.Texture('images/scodix1.png', scene); //materialPlane.useAlphaFromDiffuseTexture materialPlane.specularColor = new BABYLON.Color3(0, 0, 0); materialPlane.backFaceCulling = true;//Allways show the front and the back of an element // materialPlane.emissiveTexture.level = 1; // powerfulness var tURL = "images/scodix1.png"; var spotPlain = new BABYLON.StandardMaterial("transp", scene, true); spotPlain.diffuseTexture = new BABYLON.Texture(tURL, scene); spotPlain.anisotropicFilteringLevel = 0; spotPlain.diffuseTexture.hasAlpha = true; spotPlain.useAlphaFromDiffuseTexture; spotPlain.hasAlpha = true; spotPlain.specularColor = new BABYLON.Color3.FromHexString("#ffffff"); spotPlain.backFaceCulling = true; // Always show the front and the back of an element var sURL2 = "images/scodix2.jpg"; var materialPlane2 = new BABYLON.StandardMaterial("solid2", scene); materialPlane2.diffuseTexture = new BABYLON.Texture(sURL2, scene); // materialPlane.emissiveTexture = new BABYLON.Texture(sURL, scene); //materialPlane.emissiveTexture = new BABYLON.Texture('images/scodix1.png', scene); //materialPlane.useAlphaFromDiffuseTexture materialPlane2.specularColor = new BABYLON.Color3(0, 0, 0); materialPlane2.backFaceCulling = true;//Allways show the front and the back of an element // materialPlane.emissiveTexture.level = 1; // powerfulness var tURL2 = "images/scodix2.png"; var spotPlain2 = new BABYLON.StandardMaterial("transp2", scene, true); spotPlain2.diffuseTexture = new BABYLON.Texture(tURL2, scene); spotPlain2.anisotropicFilteringLevel = 0; spotPlain2.diffuseTexture.hasAlpha = true; spotPlain2.useAlphaFromDiffuseTexture; spotPlain2.hasAlpha = true; spotPlain2.specularColor = new BABYLON.Color3.FromHexString("#ffffff"); spotPlain2.backFaceCulling = true; // Always show the front and the back of an element var plane = BABYLON.MeshBuilder.CreatePlane("plane", {width: 261, height: 153, sideOrientation: 2}, scene, true, BABYLON.MeshBuilder.DoubleSide); plane.position = new BABYLON.Vector3(0, 0, 0.5); plane.material = materialPlane; var plane2 = BABYLON.MeshBuilder.CreatePlane("plane2", {width: 261, height: 153, sideOrientation: 2}, scene, true, BABYLON.MeshBuilder.DoubleSide); plane2.material = spotPlain; var plane3 = BABYLON.MeshBuilder.CreatePlane("plane3", {width: 261, height: 153, sideOrientation: 1}, scene, true, BABYLON.MeshBuilder.DoubleSide); plane3.position = new BABYLON.Vector3(0, 0, 0.5); plane3.material = materialPlane2; var plane4 = BABYLON.MeshBuilder.CreatePlane("plane4", {width: 261, height: 153, sideOrientation: 1}, scene, true, BABYLON.MeshBuilder.DoubleSide); plane4.material = spotPlain2; var alpha = Math.PI; scene.beforeRender = () => { } return scene;