Questions tagged [babylonjs]

JavaScript framework for building 3D games with HTML5 and WebGL.

Official site, Github, documentation.

Features

  • Complete scene graph with lights, cameras, materials and meshes
  • Collisions engine
  • Scene picking
  • Antialiasing
  • Animations engine
  • Particles Systems
  • Sprites and 2D layers
  • Optimizations engines:
    • Frustum clipping
    • Sub-meshes clipping
    • Hardware scaling
    • Selection octrees
    • Offline mode (Assets are saved locally to prevent reloading them)
    • Incremental loading
  • Standard material is a per pixel material that supports:
    • Diffuse lightning and texture
    • Ambient lightning and texture
    • Specular lightning
    • Opacity texture
    • Reflection texture (Spheric, planar, cubic and projection)
    • Mirror texture
    • Emissive texture
    • Specular texture
    • Bump texture
    • Up to 4 lights (points, directionals, spots, hemispherics)
    • Custom materials
    • Skybox
    • Vertex color
    • Bones (Animations and shadows are supported)
  • Special FX
    • Fog
    • Alpha blending
    • Alpha testing
    • Billboarding
    • Fullscreen mode
    • Shadow Maps and Variance Shadow Maps
    • Rendering layers
    • Post-processes (blur, refraction, black'n'white, fxaa, customs...)
  • Textures:
    • Render target textures
    • Dynamic textures (canvas)
    • Video textures
  • Cameras (Perspective and orthographic):
    • Arc rotate camera
    • Free camera
    • Touch camera
  • Meshes:
    • Mesh cloning
    • Dynamic meshes
    • Height maps
  • Import:
    • Babylon scene file can be converted from .OBJ, .FBX, .MXB
    • Exporter for Blender
469 questions
2
votes
1 answer

Grid Snap tool in babylon js for proper wall construction

I would like to implement a snap grid function in my pointer, but it seems when I zoom in or out, the grid distance changes. Is there a solution for this? Here is the playground: https://playground.babylonjs.com/#VHW8N9#2 I created the grid using…
2
votes
1 answer

How to set the camera in Babylon.js to be in third person?

I managed to create a code where the cameras follow the "tank" object. But with the mouse, you can zoom in and out of the camera. Tell me how to set up the camera so that it moves like in GTA behind the car? Here is an example from GTA Vice City.…
Lex34
  • 75
  • 6
2
votes
1 answer

Export Babylon.js as a native Oculus application

I'm implemented a WebXR app using Babylon.js. To run it on my Oculus Quest 2, I'm using the Oculus browser. Can I save it as a native Oculus application?
Noam Peled
  • 4,484
  • 5
  • 43
  • 48
2
votes
0 answers

React Babylon Loader OBJ File

I am try to integrate React with babylong to load an obj file, I use the example from the page, but I don't understand how to use the loader on babylon. I had this code implementation: import React from "react"; import { FreeCamera, Vector3,…
Luis Louis
  • 644
  • 6
  • 21
2
votes
0 answers

Module not found: Error: Can't resolve '@babylonjs/core/Engines/engine'

I am following a guide to setup a simple BabylonJs example with npm, webpack, typescript and ES6 (https://doc.babylonjs.com/divingDeeper/developWithBjs/npmSupport) and get the following error when running npm run build: ERROR in ./index.ts…
micmei
  • 49
  • 1
  • 6
2
votes
0 answers

Puppeteer not running on dedicated GPU

I'm trying to get this to work. My setup is a Ubuntu 18.04 with two graphic cards, one is onboard, the other one is a NVIDIA GPU. I have a monitor connected and the $DISPLAY is set to :0 My application is to take automated screenshots from…
goetzmoritz
  • 453
  • 1
  • 5
  • 23
2
votes
1 answer

How to load gltf Model in Babylonjs Reactjs project

I am using Babylonjs in Reactjs. I have successfully loaded .babylon model but I want to load .gltf model in Reactjs How can I load .gltf file model in Babylon reactjs. here is the code snippet loadModels = () => { let loader = new…
2
votes
0 answers

Unhandled expression at line :

So i am playing around with Babylon. In a createScene function I am also loading the AssetManager. Whenever i add a task, it will throw errors: unhandled expression 1 for every line of my HTML document. This also happens, if I ignore my assetManager…
2
votes
0 answers

Babylonjs Argument of type '' is not assignable to parameter of type ''

I am using babylonjs in my project and I have to import meshes with ImportMeshAsync method. This method look like this: static ImportMeshAsync(meshNames: any, rootUrl: string, sceneFilename?: string | File, scene?: Nullable, onProgress?:…
Symlis
  • 101
  • 1
  • 8
2
votes
1 answer

Drawing elements for p5.js and babylon.js in same canvas

I want to create 3D shape on my canvas, but I am using ml5.jsand posenet example. There are two ways I could think of: Approach 1: Using WEBGL renderer. But, it does not work. WEBGL renderer is required to make 3d shapes run, right? The following is…
user2698178
  • 366
  • 2
  • 11
2
votes
1 answer

Stencil JS not working with non-default imports

I'm using BabylonJS in a StencilJS app, and I can only seem to import in a very specific way. For instance I can't do: import { Engine, Scene } from "babylonjs"; It says 'Engine' is not exported by node_modules\babylonjs\babylon.js But it is.. I…
SeanMC
  • 1,960
  • 1
  • 22
  • 33
2
votes
2 answers

Loading local files into a Babylonjs scene directly

Babaylonjs is able to load babylon, gltf, obj and files into a scene. How to load a model, and its accompanying files like images for textures (or e.g. bin file for gltf, mtl file for obj), file selected from a file select dialog by an html input…
sçuçu
  • 2,960
  • 2
  • 33
  • 60
2
votes
1 answer

"Uncaught SyntaxError: Unexpected token {" when importing in TypeScript

Question: Why do I get "Uncaught SyntaxError: Unexpected token {" at line 2 of Game.ts file ? I have two typescript files listed below. I don't get any errors when compiling my project through visual studio. However, when I look at the console in my…
2
votes
1 answer

Three JS - GLTF model is dark

I have succeeded to load my model into ThreeJS using GLTFLoader but my model is dark. I tried uploading it to glTF Viewer and BabylonJS and it works perfectly there. Here is my javascript code: const scene = new THREE.Scene() const camera = new…
Mohamed Seif Khalid
  • 555
  • 1
  • 4
  • 14
2
votes
1 answer

How to refresh BabylonJs canvas?

How can I refresh the scene or canvas after I changed canvas size in BabylonJs? all I want is to re render the scene because the aspect ratio changes when the browser size is changed by the user.
amir mola
  • 355
  • 1
  • 4
  • 17
1 2
3
31 32