-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
38 lines (32 loc) · 1.28 KB
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import type {
ISceneLoaderProgressEvent,
SceneLoader,
} from '@babylonjs/core/Loading/sceneLoader';
import { Engine } from '@babylonjs/core/Engines/engine';
import { Scene } from '@babylonjs/core/scene';
import { Mesh } from '@babylonjs/core/Meshes/mesh';
import SceneHelper from './core/SceneHelper';
import '@babylonjs/core/Materials/standardMaterial';
import '@babylonjs/core/Meshes/Builders/sphereBuilder';
import '@babylonjs/core/Meshes/Builders/boxBuilder';
import '@babylonjs/core/Meshes/Builders/groundBuilder';
export default class App {
/**
* The main entry point for the 3D app.
* @param engine - an instance of the 3D engine.
*/
public createScene(engine: Engine): Scene {
const scene = new Scene(engine);
//scene.createDefaultEnvironment({});
const arcRotate: boolean = false;
SceneHelper.setupCamera(scene, arcRotate);
SceneHelper.setupLight(scene);
// Our built-in 'sphere' shape. Params: name, subdivs, size, scene
var sphere = Mesh.CreateSphere('sphere1', 16, 2, scene);
// Move the sphere upward 1/2 its height
sphere.position.y = 1;
// Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
var ground = Mesh.CreateGround('ground1', 6, 6, 2, scene);
return scene;
}
}