[英]How to load spherical panorama image tile
We have a web application which loads a spherical panorama. 我们有一个Web应用程序可加载球形全景图。 This application is developed using Three.js.
该应用程序是使用Three.js开发的。 Texture is a 360 degree image.
纹理是360度的图像。 As the image size becomes big the loading is slow.
随着图像尺寸变大,加载速度变慢。 We would like how this can be over come by tiling the images into small pieces and load the tiles of the visible part only.
我们希望通过将图像分成小块并仅加载可见部分的图块来解决这个问题。 Appreciate your help!
感谢您的帮助!
Usually 360 panoramic images are loaded in as cube-maps, so something like http://www.humus.name/Textures/SaintPetersSquare1.jpg 通常,将360幅全景图像作为立方体贴图加载,因此类似http://www.humus.name/Textures/SaintPetersSquare1.jpg
You can split the cubemap up into many images, as is done in most THREE.js examples 您可以像大多数THREE.js示例中那样将多维数据集地图分成许多图像
http://threejs.org/examples/#webgl_materials_cubemap http://threejs.org/examples/#webgl_materials_cubemap
var path = "textures/cube/SwedishRoyalCastle/";
var format = '.jpg';
var urls = [
path + 'px' + format, path + 'nx' + format,
path + 'py' + format, path + 'ny' + format,
path + 'pz' + format, path + 'nz' + format
];
var reflectionCube = THREE.ImageUtils.loadTextureCube( urls );
reflectionCube.format = THREE.RGBFormat;
var refractionCube = new THREE.CubeTexture( reflectionCube.image, THREE.CubeRefractionMapping );
refractionCube.format = THREE.RGBFormat;
To make your image loading more bearable, add an event to the image loading, using the ImageLoader and LoadManager: 为了使图像加载更容易接受,请使用ImageLoader和LoadManager在图像加载中添加一个事件:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.