forked from xeolabs/scenejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
teapot.html
110 lines (97 loc) · 4.19 KB
/
teapot.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<title>SceneJS V3 Basic Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
</head>
<body>
<script src="../../../build/latest/scenejs.js"></script>
<script src="../../libs/example-support-utils.js"></script>
<script>
var scene = SceneJS.createScene({
nodes:[
{
type:"lookAt",
eye:{ x:0.0, y:10.0, z:15 },
nodes:[
{
type:"camera",
optics:{
type:"perspective",
fovy:25.0,
aspect:1.47,
near:0.10,
far:300.0
},
nodes:[
{
type:"lights",
lights:[
{
mode:"ambient",
color:{ r:0.6, g:0.6, b:0.4 },
diffuse:true,
specular:false
},
{
mode:"dir",
color:{ r:1.0, g:1.0, b:1.0 },
diffuse:true,
specular:true,
dir:{ x:1.0, y:-0.5, z:-1.0 },
space:"world"
},
{
mode:"dir",
color:{ r:1.0, g:1.0, b:0.8 },
diffuse:true,
specular:false,
dir:{ x:0.0, y:-0.5, z:-1.0 },
space:"world"
}
],
nodes:[
{
id:"pitch",
type:"rotate",
angle:0.0,
x:1.0,
nodes:[
{
id:"yaw",
type:"rotate",
angle:0.0,
y:1.0,
nodes:[
{
type:"material",
emit:0,
baseColor:{ r:0.5, g:0.5, b:0.6 },
specularColor:{ r:0.9, g:0.9, b:0.9 },
specular:1.0,
shine:70.0,
nodes:[
{
type:"geometry",
plugin:"teapot"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
});
scene.start();
mouseOrbitUtility(scene);
</script>
</body>
</html>