forked from xeolabs/scenejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
effects_oculusRift_pickFlyOrbit.html
94 lines (77 loc) · 2.98 KB
/
effects_oculusRift_pickFlyOrbit.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!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="infoLight">
<a href="http://scenejs.org">SceneJS</a> - Oculus Rift effect with pick-fly-orbit camera
<br>
click on something to fly to that point
<br>
drag mouse to orbit it, mouse wheel to zoom in and out
</div>
<script>
//-----------------------------------------------------------------------------------------------------------------
// Using an "effects/oculusRift" node in combination with a "cameras/pickFlyOrbit"
//-----------------------------------------------------------------------------------------------------------------
// Point SceneJS to the bundled plugins
SceneJS.setConfigs({
pluginPath: "../api/latest/plugins"
});
// Create scene
var scene = SceneJS.createScene({
nodes: [
// Mouse-orbited camera, implemented by plugin at
// http://scenejs.org/api/latest/plugins/node/cameras/pickFlyOrbit.js
{
type: "cameras/pickFlyOrbit",
yaw: -0,
pitch: -40,
eye: { x: -10, y: 50, z: -100 },
look: { x: -10, y: 50, z: 0 },
zoomSensitivity: 20.0,
showCursor: true,
cursorSize: 2.0,
nodes: [
// Oculus Rift effect, implemented by plugin at:
// http://scenejs.org/api/latest/plugins/node/effects/oculusRift.js
{
type: "effects/oculusRift",
nodes: [
// Cloudy sea skybox, implemented by plugin at http://scenejs.org/api/latest/plugins/node/skybox/cloudySea.js
{
type: "skybox/cloudySea",
size: 5000 // Box half-size on each axis - default is 5000
},
// City demo scene
// http://scenejs.org/api/latest/plugins/node/models/buildings/city.js
{
type: "models/buildings/city"
},
// Ground
// http://scenejs.org/api/latest/plugins/node/ground/grid.js
{
type: "models/ground/grid"
}
]
}
]
}
]
});
</script>
</body>
</html>