我正在尝试使用THREE.js创建球形全景图。它在Safari桌面上运行良好,但在iPAD上的Safari Mobile上崩溃。它与我加载纹理图像的方式有关。
我尝试过的一些事情
这是我的代码。 http://pastebin.com/1nwTMHJV
sceneHolder = document.getElementById( 'sceneHolder' );
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 60, SCENE_WIDTH / SCENE_HEIGHT, 1, 10000 );
camera.position.z = 0;
scene.add( camera );
var sphereGeom = new THREE.SphereGeometry( 200, 20, 20 );
//NOTE: If we add {},function(){render()} in the following, it stops working!
var sphereTexture = THREE.ImageUtils.loadTexture('media/vr/testpot.jpg');
mesh = new THREE.Mesh(sphereGeom,new THREE.MeshBasicMaterial({map:sphereTexture,overdraw:true}));
//So that we see the inside of the sphere too!
mesh.doubleSided=true;
scene.add( mesh );
renderer = new THREE.CanvasRenderer();
renderer.setSize( SCENE_WIDTH, SCENE_HEIGHT );
sceneHolder.appendChild( renderer.domElement );
这是我在THREE.js上的帖子 https://github.com/mrdoob/three.js/issues/1529
另外:https://github.com/mrdoob/three.js/issues/1550
由于 smaira
答案 0 :(得分:0)
我试过,降低脸部的数量可以在iPad上运行,但它只是丑陋。
你可以试试:var sphereGeom = new THREE.SphereGeometry( 200, 10, 10 );
和渲染时的safari崩溃
renderer.render( scene, camera );
结论: 如果将图像纹理加载到具有太多面孔的球体,iPad将崩溃