2012-03-19 68 views
3

我想創建一個使用THREE.js球形全景。它在Safari桌面上運行良好,但在iPAD上的Safari Mobile上崩潰。這與我加載紋理圖像的方式有關。Safari移動 - 崩潰 - 三JS紋理不加載

有幾件事情我已經試過

  1. 我使用Canvas渲染
  2. 試圖裝載了更小尺寸的圖像。
  3. 嘗試加載2紋理圖像的冪。
  4. 試圖用線框材料加載球體 - 它的工作原理!

這是我的代碼。 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

我有這個確切的問題,任何更新? – 2014-02-02 16:44:34

回答

0

我試過,降低面數可在iPad上運行,但它的只是醜陋。

,你可以嘗試:

var sphereGeom = new THREE.SphereGeometry(200, 10, 10); 

,並在當時的Safari瀏覽器崩潰渲染

renderer.render(scene, camera); 

結論: 如果加載圖像紋理與多面球體,iPad將崩潰