-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.js
37 lines (28 loc) · 928 Bytes
/
init.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
36
37
import baseobj from "./baseobj.js";
import shaders from "./shaders.js";
import vis from "./vis.js";
import utils_setup from "./utils/init.js";
import vis_threejs_setup from "./vis-threejs/init.js";
//import components_setup from "./components/init.js";
import components_threejs_setup from "./components-threejs/init.js";
export function setup( vz, opts={} ) {
if (!vz.vis) vz.vis = {};
utils_setup( vz );
baseobj( vz, vz.vis );
shaders( vz );
vis( vz );
vis_threejs_setup( vz );
// components_setup( vz );
components_threejs_setup( vz );
vz.register_feature_set( {scene_screenshot} );
}
/////////////////
export function scene_screenshot(env) {
env.sceneScreenShot = (format="image/png") => {
var img = renderer.domElement.toDataURL(format);
return img;
}
env.sceneScreenShotBlob = (format="image/png",cb) => {
renderer.domElement.toBlob(cb,format);
}
}