【发布时间】:2014-08-21 18:56:25
【问题描述】:
我正在尝试使用 THREE.js 创建一个球形全景图。它在 Safari Desktop 上运行良好,但在 iPAD 上的 Safari Mobile 上崩溃。它与我加载纹理图像的方式有关。
我尝试过的一些事情
- 我正在使用画布渲染器
- 尝试加载较小尺寸的图片。
- 尝试加载 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
谢谢 斯迈拉
【问题讨论】:
-
我遇到了这个确切的问题,有更新吗?
标签: javascript ipad 3d mobile-safari three.js