-
Notifications
You must be signed in to change notification settings - Fork 1
/
main-scene.js
35 lines (24 loc) · 1.45 KB
/
main-scene.js
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
import {defs, tiny} from './examples/common.js';
import {Transforms_Sandbox} from "./examples/transforms-sandbox.js"
import {TurtleMania} from "./turtlemania.js"
import {Scene_To_Texture_Demo} from "./examples/scene-to-texture-demo.js"
import {Mouse_Demo} from "./examples/mouse-demo.js"
// Pull these names into this module's scope for convenience:
const {
Vector, Vector3, vec, vec3, vec4, color, Matrix, Mat4, Light, Shape, Material, Shader, Texture, Scene,
Canvas_Widget, Code_Widget, Text_Widget
} = tiny;
// Now we have loaded everything in the files tiny-graphics.js, tiny-graphics-widgets.js, and common.js.
// This yielded "tiny", an object wrapping the stuff in the first two files, and "defs" for wrapping all the rest.
// ******************** Extra step only for when executing on a local machine:
// Load any more files in your directory and copy them into "defs."
// (On the web, a server should instead just pack all these as well
// as common.js into one file for you, such as "dependencies.js")
const Minimal_Webgl_Demo = defs.Minimal_Webgl_Demo;
Object.assign(defs,
{Transforms_Sandbox}, {TurtleMania}, {Scene_To_Texture_Demo}, {Mouse_Demo});
// ******************** End extra step
// (Can define Main_Scene's class here)
const Main_Scene = TurtleMania;
const Additional_Scenes = [];
export {Main_Scene, Additional_Scenes, Canvas_Widget, Code_Widget, Text_Widget, defs}