在IE9中,Three.js会抛出场景对象和float32array的错误

时间:2015-01-13 07:52:24

标签: javascript three.js webgl

当尝试使用CanvasRenderer绘制3D对象以使其在IE9中兼容时,我收到错误float32array错误,场景错误。

我的代码在这里 -

            var renderer = new THREE.CanvasRenderer(); // Fallback to canvas renderer, if necessary.
            renderer.setSize(window.innerWidth, window.innerHeight); 
            document.body.appendChild(renderer.domElement); 
            var scene = new THREE.Scene(); 
            var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); 
            var geometry = new THREE.CubeGeometry(20, 20, 20); 
            var material = new THREE.MeshBasicMaterial({ color: 0x0000FF }); 
            var cube = new THREE.Mesh(geometry, material); 
            scene.add(cube); 

            camera.position.z = 50; 

            var render = function () {
            cube.rotation.x += 0.01; 
            cube.rotation.y += 0.01;

            renderer.render(scene, camera);
            requestAnimationFrame(render); 
            };

            render(); // Start the rendering of the animation frames.

有什么建议吗?

0 个答案:

没有答案