3
我想創建一個使用THREE.js球形全景。它在Safari桌面上運行良好,但在iPAD上的Safari Mobile上崩潰。這與我加載紋理圖像的方式有關。Safari移動 - 崩潰 - 三JS紋理不加載
有幾件事情我已經試過
- 我使用Canvas渲染
- 試圖裝載了更小尺寸的圖像。
- 嘗試加載2紋理圖像的冪。
- 試圖用線框材料加載球體 - 它的工作原理!
這是我的代碼。 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
我有這個確切的問題,任何更新? – 2014-02-02 16:44:34