x
 
1
<!DOCTYPE html>
2
<html>
3
    <head>
4
        <meta charset="utf-8">
5
        <style>
6
            body {
7
                background-color: #00ffff;
8
                margin: 0;
9
                overflow: hidden;
10
            }
11
        </style>
12
    </head>
13
    <body>
14
        <!--three.js V77-->
15
        <script src="js/threejs/three.js"></script>
16
        <script src="js/threejs/StereoEffect.js"></script>
17
        <script src="js/threejs/DeviceOrientationControls.js"></script>
18
        <script src="js/threejs/OrbitControls.js"></script>
19
        <script>
20
21
            var camera, scene, renderer;
22
            var effect, controls, world;
23
            var clock = new THREE.Clock();
24
25
            World = function()
26
            {
27
                this.init = function(scene)
28
                {
29
                    this.box = new THREE.Mesh( new THREE.BoxGeometry( 100, 200, 200 ),  new THREE.MeshNormalMaterial() );
30
                    scene.add(this.box);
31
                };
32
                this.update = function(dt)
33
                {
34
                    this.box.rotation.x += dt * 0.5;
35
                    this.box.rotation.y += dt;
36
                };
37
            };
38
39
            
40
            var init = function () {
41
                renderer = new THREE.WebGLRenderer();
42
                document.body.appendChild( renderer.domElement );
43
                // Stereo / Vr effect :
44
                effect = new THREE.StereoEffect(renderer);
45
46
                camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 1000 );
47
                camera.position.z = -400;

adb