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
    • 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

Found 351 results

  1. Hello! I started with three js and, while its fine, I'm noticing that the community for Babylon is more responsive to new people's questions. I'm just starting with Babylon JS, so I'm not sure what equivalent methods are. What I'm trying to do, eventually, is to create a heatmap, based on a series of random points, over the surface of a loaded object. Here's what I'm trying to do step by step: 1. load up a model and generate X-number of random points on its geometry. In THREE JS i used: function loadPartModel( callback ) { var modelloader = new THREE.JSONLoader(); partmodel = modelloader.parse(face); var material = new THREE.MeshPhongMaterial({ color: 0xFFFFFF, dithering: true, side: THREE.DoubleSide, vertexColors: THREE.FaceColors, overdraw: true }); partmesh = new THREE.Mesh(partmodel.geometry, material); partmesh.position.set(0, 0, 0); partmesh.receiveShadow = true; partmesh.castShadow = true; partmesh.geometry.dynamic = true; partmesh.scale.set(1, 1, 1); scene.add(partmesh); } function loadDataPoints() { var pointlist = THREE.GeometryUtils.randomPointsInGeometry(loadedmodel.geometry, 200); pointlist.forEach(function (point) { var newpoint = new THREE.Mesh( new THREE.CircleGeometry(.1, 16), new THREE.MeshBasicMaterial({ color: 0xff0000 })); newpoint.position.set(point.x, point.y, point.z); scene.add(newpoint); }); } Is there a babylon equivalent for the random point generator? 2. Each generated point becomes the center of a circle (disc, in babylon?). At render point, the object should look like it has the measles (kind of like the attached GoodCircle.PNG) . Unfortunately, this is how they end up rendering. Like disks stuck in the object instead of laying over the object(as shown in BadCircles.PNG). I think my main problem is that I'm actually just drawing and adding circles that have centers based on the random coordinates i generate. Instead I should be calculating the surface area of a circle over the model and redoing its material at that point? Anyway, at this step, I'm stuck. 3. Once I'm able to accomplish this, I believe the next step would be to get something like the attachment, heatmap.PNG. This was generated by the simpleheat.js library. The closer the circles are to each other, the 'hotter' the cluster area gets. I've been looking at several code samples that allow a user to paint a 3D object using their mouse (look at skullpaint). I need to do something similar but instead of using mouse input, using the randomly generated points. I also found this Playground by Gijs for mangomongo that kind of does what I can do now, but it uses mouse input. I need my points to be read from a file or data structure.
  2. Hello everyone, I'd like to make drag n drop on meshes keeping the link between meshes, like in this example ( I don't know how to set the position of curve ? -> Maybe, with, and the example, but I don't understand why position table is so big, and to set from mesh position ? Thank you
  3. As you can see above, my GUI's output is all wrong. What could possibly be the issue here?
  4. I tried to export unity scene from unity and enable the physics. But I can't find where babylon create the mesh in index.html that export from unity and what babylon do to recognise all model in unity scene? As I want to set the mass for each model , is there some where can find the register for all game objects ? Anyone also can explain how babylon work with the cannonjs to set the collider for each model ?
  5. Hello, Possible Bug in Assets Manager Audio. QUESTIONS: Is this a bug, is it related to M64 and M65, does anyone have any insight on M64 and M65? STEPS: 1) Run the Audio test ( from these docs ( and no audio. Reproduced in Dev environment. Along with interesting deprecation messages in the console. below... (maybe not related?): [Deprecation] GainNode.gain.value setter smoothing is deprecated and will be removed in M64, around January 2018. Please use setTargetAtTime() instead if smoothing is needed. See [Deprecation] AudioParam value setter will become equivalent to AudioParam.setValueAtTime() in M65, around March 2018 See for more details. Interesting. NOTE: Possible bug behavior seems limited to AssetsManager, as I can still use direct load sound and it works. QUESTIONS: Is this a bug, is it related to M64 and M65, does anyone have any insight on M64 and M65? ping @davrous ... : ) Thanks,
  6. setEnabled is not working in v3.2.0AlphaA

    Hi, mesh.setEnabled(0); it is not working in v3.2.0 AlphaA not only AlphaA it was not working from v3.2.0 Alpha2
  7. How to color line ? I tried to use the option colors of CreateLines, but it doesn't seem to work. Maybe, I forgot something
  8. Hi everyone, i was stuck in performance of game DETAIL: the above picture shows the game with screen zoom is 100 percentage this picture show the screen zoom size with 25 percentage when the zoom size is 100 % the game performance is good but when i change the zoom size of screen to below 50 percentage there is lack of performance(the player will move very very slowly) when screen zoom size is 67 - 100 percentage fps : 60 when screen zoom size is 50 - 67 percentage fps : 45 - 50 when screen zoom size is less than 50 percentage fps : 15 - 20 when on igcnito mode when screen zoom size is 200 - 500 percentage fps : 55 when screen zoom size is 110 - 200 percentage fps : 50 when screen zoom size is 67 - 100 percentage fps : 45 when screen zoom size is 50 - 67 percentage fps : 35 when screen zoom size is less than 50 percentage fps : not running anyone know what is the problem??? and how to make fps 60 for all zoom size of screen??
  9. Hey, I would like to know where is stored advancedDynamicTexture in babylon environnment. For example, all the meshes are stored in the scene at the "meshes" property. I want to play with the Babylon gui ;).
  10. Hi Everyone, i have doubt in progressHandler using importmesh BABYLON.SceneLoader.ImportMesh("", "assets/", "meshes.babylon", scenes, function (newMeshes, particleSystems, skeletons) { obstacleBig = scenes.getMeshByName("terminal"); obstacleSmall2 = scenes.getMeshByName("sky_bin"); obstacleSmall = scenes.getMeshByName("round_planter"); coin = scenes.getMeshByName("Coin"); boostObj = scenes.getMeshByName("Boost"); floor[0] = scenes.getMeshByName("Platform001"); floor[1] = scenes.getMeshByName("Platform002"); stLamp = scenes.getMeshByName("lamp"); wideAd = scenes.getMeshByName("Ad_B"); lengthAd = scenes.getMeshByName("Ad_C"); plot = scenes.getMeshByName("platform_LOD_1"); directionArrow = scenes.getMeshByName("Sign_arrow"); }, function (evt) { if (evt.lengthComputable) { loadingProgress = (evt.loaded * 100 /; } }, function(scenes, msg, exception){ console.log("error while loading assets"); console.log(scenes); console.log(msg); console.log(exception); } ); onprogress functions will be run at 1st time but not in second time means when i run my game at first time on pc it will run after that when i refresh/run the game the onProgress function is not executing. but it will run after clearing the cache file(only for 1st time) i can't clear cache in everytime so anyone have solution for this???
  11. Animation not playing

    Hi Everyone, If i load the game in first time it doesn’t load the animation for some time and the character looks frozen But i'm first time facing this issue how can i fix it???
  12. Сoordinates to the object

    Hi friends! Is the object A is object B. Is there a way to give new coordinates to the object B, but so that the center coordinates was the object A? But object a does not become the parent of object B!
  13. Model flip issue

    Hi Everyone, I was stuck in modelling. when i use 3d model of unity and then i was converted it to babylon file using 3ds max. but sometimes in rendering the model will be look like image below. Anyone know why it is happening to me
  14. Warp Effect

    Hi friends, how to add the warp effect in my world. i need warp effect without using the shader like this; how to get warp effect using the jquery-warpdrive in my world ref: can you have any idea about this?????????....... Thanks
  15. Hi friends, it is syed, how to group the animation from the mesh, i'm having 2 animated meshes how to group the animation of two meshes
  16. How to join two mesh

    Hi Everyone, How to attach the two meshes using script. for example: Two meshes i) skateboard ii) player(animated with 3ds max) i will use this to attach sword.attachToBone(skeleton.bones[34], character); Note: i want to attach two meshes i) the skateboard don't move while playing the players animation Advance Thanks...
  17. Complex animation

    Hi Everyone, i have a doubt. i'm using complex animation. i want to play, stop and restart based on the situation, i was refer the documentation my script was given below but i was not running. is there anything wrong in this script idleAnim = scene.beginAnimation(player.skeleton, 0, 60, true, 1.0); idleAnim.restart();
  18. Rescale Skybox size

    Hi Everyone, i have a doubt. How to get big skybox. i need the size 2500 is this possible i'm using this script skybox = BABYLON.Mesh.CreateBox("skyBox", 1000.0, scene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); skyboxMaterial.backFaceCulling = false; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("assets/skybox/skybox", scene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); skybox.material = skyboxMaterial;
  19. Hi Team, I am using arc rotate camera in the scene. There is delay/animation in panning when pressed control+drag. I want the panning to happen on the go without delay. I am trying to modify the native library code for arc rotate camera, but the snippet itself is loaded with delay. Is there a way to disable delay/animation in panning effect? if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) { console.log('Start Drag---------------') console.log(new Date()) if (!this._localDirection) { this._localDirection = BABYLON.Vector3.Zero(); this._transformedDirection = BABYLON.Vector3.Zero(); } this.inertialPanningX *= this.inertia; this.inertialPanningY *= this.inertia; if (Math.abs(this.inertialPanningX) < BABYLON.Epsilon) this.inertialPanningX = 0; if (Math.abs(this.inertialPanningY) < BABYLON.Epsilon) this.inertialPanningY = 0; this._localDirection.copyFromFloats(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY); this._localDirection.multiplyInPlace(this.panningAxis); this._viewMatrix.invertToRef(this._cameraTransformMatrix); BABYLON.Vector3.TransformNormalToRef(this._localDirection, this._cameraTransformMatrix, this._transformedDirection); //Eliminate y if map panning is enabled (panningAxis == 1,0,1) if (!this.panningAxis.y) { this._transformedDirection.y = 0; } if (! {; } console.log(new Date()) console.log('End Drag---------------') } also tried setting various values to speed, panningSensibility, cameraAcceleration.
  20. Hi Everyone, i have a doubt how to run a two animation simultaneously from a same skeleton without affecting 1st one. i will play animation using below script. i want to run this two animation without out affecting 1st one. is this possible?? scene.beginAnimation(player.skeleton, 61, 126, true, 1.0); scene.beginAnimation(player.skeleton, 0, 30, true, 1.0);
  21. Hi, I have a doubt.. how to rotate and scaling the animated mesh without affecting the mesh shape and other. which was imported using the importmesh function. Advance thanks for response
  22. Using latest blender 2.79 and latest exporter from Babylon team: Camera and a cube animated 1-990 frames. On export, two things wrong occur: cube position array is cloned to camera, ensuring camera playback is dead center of cube once returned to blender, all /most keyframes sometimes deleted. As a diagnostic task, I removed the box to only export the camera, which resulted in the camera keyframes being deleted and no file exported at all, resulting in a large diagostic failure log. It appears the exporter deletes the camera and keyframes during export, then attempts to export empty data ( list out of range ) For files see :
  23. How to get loading screen

    how to get loading screen like this
  24. Hi Everyone, How to visually check the sphere imposter shape and size of player in babylon???
  25. GUI Performance

    Hello, I am trying to use the GUI TextBlock and Image components to display an icon and a text underneath it (number count) on top of a hexagon. In the scene, there can be hundreds of hexagons at once. Without instantiating the GUI components, the scene runs with no much problem at all, 200~ hexagons at 60fps... With it, the fps drops considerably. Is there any GUI optimization advice you guys can give me? I would appreciate it. constructor(parentHex, text, sizeScale, icon) { if (global.Image) { const GUI = require('babylonjs-gui'); const materialType = MATERIAL_TYPES.DYNAMIC_LABEL; const name = `hex_label_plane_${sizeScale}`; let plane = Main.scene.getMeshByName(name); if (!plane) { plane = BABYLON.MeshBuilder.CreatePlane(name, { size: 1.1 * sizeScale }, Main.scene); Util.setMaterial(plane, materialType); Util.setScalingToZero(plane); } plane = plane.clone('clone'); plane.position = Util.getNewVector(parentHex.position); plane.position.y += (parentHex.extents.y * Config.HEX_Y_SCALE) + 0.01; plane.rotation.x = Math.PI / 2; Util.setScalingToOne(plane); plane.setParent(parentHex); plane.originalScaling = Util.getNewVector(plane.scaling); plane.setVisibility = (visible) => { visible ? Util.setScalingToZero(plane) : Util.resetScaling(plane); }; const panel = new GUI.StackPanel(); panel.verticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_CENTER; this._panel = panel; if (icon) { const image = new GUI.Image('hexLabelIcon', icon); image.height = `${Config.HEX_LABEL_ICON_HEIGHT / sizeScale}px`; image.paddingBottom = `${Config.HEX_LABEL_ICON_PADDING_BOTTOM / sizeScale}px`; image.verticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_BOTTOM; image.stretch = GUI.Image.STRETCH_UNIFORM; panel.addControl(image); } const textBlock = new GUI.TextBlock(`hex_label_${text}`, text); textBlock.height = `${Config.HEX_LABEL_FONT_SIZE / sizeScale}px`; textBlock.color = 'black'; textBlock.fontSize = `${Config.HEX_LABEL_FONT_SIZE / sizeScale}px`; textBlock.textVerticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_TOP; panel.addControl(textBlock); this.advancedTexture = GUI.AdvancedDynamicTexture.CreateForMesh(plane); this.advancedTexture.addControl(panel); return plane; } }