forked from acweathersby/js.blend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
48 lines (40 loc) · 1.38 KB
/
index.html
File metadata and controls
48 lines (40 loc) · 1.38 KB
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
<!DOCTYPE html>
<html>
<head>
<title>JS.BLEND Example</title>
<script type="text/javascript" src="./build/js.blend.js"></script>
<script type="text/javascript" src="./example/three.js"></script>
<script type="text/javascript" src="./example/orbit_controls.js"></script>
</head>
<body>
<script type="text/javascript">
//threes js code
var scene = new THREE.Scene();
scene.background = new THREE.Color(0.5, 0.2, 0.5);
var camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.1, 100);
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
function render() {
renderer.render(scene, camera);
}
//camera.rotation.y = 90;
camera.position.z = 10;
controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.addEventListener('change', render); // remove
controls.enableZoom = true;
var light = new THREE.PointLight(0xFFFFFF, 0.8, 1000);
light.position.set(0, 0, 10);
//scene.add(light);
var light = new THREE.PointLight(0xFFFFFF, 0.8, 0);
light.position.set(0, 0, -10);
//scene.add(light);
JSBLEND('./example/test.blend').then((blend) => {
blend.three.loadScene(scene);
render();
}).catch((error)=>{
console.log(error);
});
</script>
</body>
</html>