forked from xeolabs/xeogl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
featured_metallicTorus.html
50 lines (40 loc) · 1.28 KB
/
featured_metallicTorus.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>xeogl Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<link href="css/styles.css" rel="stylesheet"/>
<script src="../build/xeogl.js"></script>
<body>
<div id="info">
<h1><a href="../docs/classes/Mesh.html" target="_parent">Mesh</a> with <a href="../docs/classes/TorusGeometry.html" target="_parent">TorusGeometry</a> and <a href="../docs/classes/MetallicMaterial.html" target="_parent">MetallicMaterial</a></h1>
</div>
<div id="dat-gui-container">
</div>
<script>
var geometry = new xeogl.TorusGeometry({
radius: 1.0,
tube: 0.3,
radialSegments: 120,
tubeSegments: 60
});
var material = new xeogl.MetallicMaterial({
baseColorMap: new xeogl.Texture({
src: "textures/diffuse/uvGrid2.jpg"
}),
roughnessMap: new xeogl.Texture({
src: "textures/roughness/goldRoughness.jpg"
})
});
var mesh = new xeogl.Mesh({
geometry: geometry,
material: material
});
mesh.scene.camera.eye = [0, 0, -4];
mesh.scene.on("tick", function () {
mesh.scene.camera.orbitYaw(0.2);
});
</script>
</body>
</html>