forked from xeolabs/xeogl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geometry_primitives_cylinder.html
46 lines (37 loc) · 1.07 KB
/
geometry_primitives_cylinder.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
<!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/CylinderGeometry.html" target="_parent">CylinderGeometry</a></h1>
</div>
<script>
var mesh = new xeogl.Mesh({
geometry: new xeogl.CylinderGeometry({
radiusTop: 2.0,
radiusBottom: 2.0,
height: 5.0,
radialSegments: 20,
heightSegments: 1,
openEnded: false
}),
material: new xeogl.PhongMaterial({
diffuseMap: new xeogl.Texture({
src: "textures/diffuse/uvGrid2.jpg"
})
})
});
var scene = mesh.scene;
var camera = scene.camera;
scene.on("tick", function () {
camera.orbitYaw(0.6);
camera.orbitPitch(0.3);
});
</script>
</body>
</html>