forked from xeolabs/scenejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configs_pluginPath.html
80 lines (70 loc) · 2.63 KB
/
configs_pluginPath.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="en">
<head>
<title>SceneJS Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
margin: 0;
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
}
</style>
<script src="../api/latest/scenejs.min.js"></script>
<link href="css/styles.css" rel="stylesheet"/>
</head>
<body>
<div id="infoDark">
<a href="http://scenejs.org">SceneJS</a> - configuring the plugin path<br>
many of the scene node types you use with SceneJS are plugins that extend the core node types.<br>
SceneJS will load those types on-demand from scripts found on the plugin path, such as the <a
href="../api/latest/plugins/node/geometry/torus.js" target="_other">torus</a> in this demo
</div>
<script>
// To keep the core library small, SceneJS dynamically loads it's non-core functionality from a directory of
// plugins. In these examples SceneJS loads them on-demand from the plugins directory within its repository on
// GitHub.
//
// When you'd rather serve the plugins yourself, or run a scene offline, then you'll need to configure
// SceneJS to load the plugins from your own location, as shown in this example.
//
// Point SceneJS to the plugins bundled with these examples:
SceneJS.setConfigs({
pluginPath: "../api/latest/plugins"
});
var scene = SceneJS.createScene({
nodes: [
// Mouse-orbited camera,
// implemented by plugin at ../api/latest/plugins/node/cameras/orbit.js
{
type: "cameras/orbit",
yaw: 30,
pitch: -30,
zoom: 5,
zoomSensitivity: 2.0,
nodes: [
{
type: "material",
color: { r: 0.6, g: 0.6, b: 0.9 },
nodes: [
// Torus primitive,
// implemented by plugin at ../api/latest/plugins/node/geometry/torus.js
{
type: "geometry/torus",
radius: 1.0,
tube: 0.30,
segmentsR: 60,
segmentsT: 40,
arc: Math.PI * 2
}
]
}
]
}
]
})
</script>
</body>
</html>