在three.js中使用多个几何体时,Canvas渲染器崩溃

时间:2013-12-16 08:28:16

标签: three.js

基于某些参数,我通过指定不同的PI和theta值来创建多个球体几何。例如

var parent = new THREE.Object3D();
scene.add( parent );

var geometry = new THREE.SphereGeometry( 5, 24, 16, 0 * Math.PI/2, Math.PI/2 );
var material = new THREE.MeshLambertMaterial( { map: texture0 } );
mesh = new THREE.Mesh( geometry, material );
parent.add( mesh );

var geometry = new THREE.SphereGeometry( 5, 24, 16, 1 * Math.PI/2, Math.PI/2 );
var material = new THREE.MeshLambertMaterial( { map: texture1 } );
mesh = new THREE.Mesh( geometry, material );
parent.add( mesh );

var geometry = new THREE.SphereGeometry( 5, 24, 16, 2 * Math.PI/2, Math.PI/2 );
var material = new THREE.MeshLambertMaterial( { map: texture2 } );
mesh = new THREE.Mesh( geometry, material );
parent.add( mesh );

var geometry = new THREE.SphereGeometry( 5, 24, 16, 3 * Math.PI/2, Math.PI/2 );
var material = new THREE.MeshLambertMaterial( { map: texture3 } );
mesh = new THREE.Mesh( geometry, material );
parent.add( mesh );

当我创建多个几何体时,它可以与THREE.WebGLRenderer一起使用,但是当我使用THREE.CanvasRenderer()时,浏览器会崩溃。如何解决问题。我希望我的应用程序在IE10及更低版本上运行,只支持THREE.CanvasRenderer。

提前致谢。

0 个答案:

没有答案