|
|
8 vuotta sitten | |
|---|---|---|
| .vscode | 8 vuotta sitten | |
| Exporters | 8 vuotta sitten | |
| Playground | 8 vuotta sitten | |
| Tools | 8 vuotta sitten | |
| Viewer | 8 vuotta sitten | |
| assets | 8 vuotta sitten | |
| dist | 8 vuotta sitten | |
| gui | 8 vuotta sitten | |
| inspector | 8 vuotta sitten | |
| loaders | 8 vuotta sitten | |
| localDev | 8 vuotta sitten | |
| materialsLibrary | 8 vuotta sitten | |
| postProcessLibrary | 8 vuotta sitten | |
| proceduralTexturesLibrary | 8 vuotta sitten | |
| sandbox | 8 vuotta sitten | |
| serializers | 8 vuotta sitten | |
| src | 8 vuotta sitten | |
| tests | 8 vuotta sitten | |
| .gitattributes | 10 vuotta sitten | |
| .gitignore | 8 vuotta sitten | |
| .gitmodules | 12 vuotta sitten | |
| .travis.yml | 8 vuotta sitten | |
| bower.json | 9 vuotta sitten | |
| contributing.md | 9 vuotta sitten | |
| favicon.ico | 8 vuotta sitten | |
| license.md | 8 vuotta sitten | |
| package.json | 8 vuotta sitten | |
| readme.md | 8 vuotta sitten | |
| tslint.json | 8 vuotta sitten | |
| what's new.md | 8 vuotta sitten |
Getting started? Play directly with the Babylon.js API via our playground. It contains also lot of simple samples to learn how to use it.
Any questions? Here is our official forum on www.html5gamedevs.com.
Additional references can be found on https://cdn.babylonjs.com/xxx where xxx is the folder structure you can find in the /dist folder like https://cdn.babylonjs.com/gui/babylon.gui.min.js
For preview release you can use the following ones:
Additional references can be found on https://preview.babylonjs.com/xxx where xxx is the folder structure you can find in the /dist/preview release folder like https://preview.babylonjs.com/gui/babylon.gui.min.js
BabylonJS and its modules are published on NPM with full typing support. To install use
npm install babylonjs --save
This will allow you to import BabylonJS entirely using:
import * as BABYLON from 'babylonjs';
or individual classes using:
import { Scene, Engine } from 'babylonjs';
If using TypeScript, don't forget to add 'babylonjs' to 'types' in tsconfig.json:
....
"types": [
"babylonjs",
"anotherAwesomeDependency"
],
....
To add a module install the respected package. A list of extra packages and their installation instructions can be found on babylonjs' user at npm.
Using an HTML file:
<script src="https://cdn.babylonjs.com/babylon.js"></script>
Or in Javascript/Typescript using a bundler such as Webpack or Parcel:
import * as BABYLON from 'babylonjs';
// Create canvas html element on webpage
var canvas = document.createElement('canvas');;
document.body.appendChild(canvas);
// Initialize Babylon scene and engine
var engine = new BABYLON.Engine(canvas, true);
var scene = new BABYLON.Scene(engine);
engine.runRenderLoop(()=>{
scene.render();
});
// Create objects in the scene
var camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(0, 0, 0), scene);
camera.attachControl(canvas,true)
var light = new BABYLON.PointLight("light", new BABYLON.Vector3(10,10,0), scene);
var box = BABYLON.Mesh.CreateBox("box", 1.0, scene);
box.position.z = 5;
// Run's once per game frame
scene.onBeforeRenderObservable.add(()=>{
box.position.x += 0.01;
box.rotation.x += 0.01;
box.rotation.y += 0.01;
});
Preview version of 3.2 can be found here. If you want to contribute, please read our contribution guidelines first.
To get a complete list of supported features, please visit our website.