-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathindex.html
57 lines (46 loc) · 1.38 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>hello three</title>
</head>
<body>
<script src="lib/three.min.js"></script>
<script src="lib/StereoEffect.js"></script>
<script src="lib/OrbitControls.js"></script>
<script src="js/threeQuery.min.js"></script>
<script>
var scene, camera, renderer;
[scene, renderer, camera] = $$.init();
$$.global.settings.vr = true;
camera.position.y = 20;
var controls = $$.Controls.createOrbitControls();
var light = new THREE.HemisphereLight(0xaaaaaa, 0x000000, 0.6);
scene.add(light);
$$.Loader.loadTexture(["textures/patterns/checker.png",
"textures/patterns/aaa.jpg"
]);
$$.Loader.onLoadComplete = function() {
var texture = $$.Loader.RESOURCE.textures["textures/patterns/checker.png"];
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat = new THREE.Vector2(50, 50);
texture.anisotropy = renderer.getMaxAnisotropy();
var material = new THREE.MeshPhongMaterial({
color: 0xffffff,
specular: 0xffffff,
shininess: 20,
shading: THREE.FlatShading,
map: texture
});
var geometry = new THREE.PlaneGeometry(1000, 1000);
var mesh = new THREE.Mesh(geometry, material);
mesh.rotation.x = -Math.PI / 2;
scene.add(mesh);
}
$$.animate(function() {
controls.update;
});
</script>
</body>
</html>