如何使用react VR预加载图像? [英] How do I preload images using react VR?

查看:103
本文介绍了如何使用react VR预加载图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用React VR进行虚拟旅行,并在用户从房间运输时预加载下一张全景图像。预加载后我会使用本地磁盘缓存中的图像。



我在下面尝试过这段代码



I'm making a virtual tour in a house using React VR and would preload next panorama image when the user transport from room. After preload I would use the image from the local disk cache.

I've tried this code below

<Pano style={{ display: 'none' }} source={asset(`360/${this.thePanoImage}`)} />





但它没有在此图片上看到。



红线以上是虚拟旅游首次加载的时间。你会看到 leefruimte.jpg 是在9毫秒内下载的。运输(在红线下) leefruimte.jpg 再次下载,但现在在12毫秒内。



我接受图像 leefruimte.jpg 是从场景零中加载的图像中取出并缓存的。



图片 navigationCircle.png focusspot.png ,不会预先加载。



我尝试过:



见上文:





But it doesn't see on this image.

Above the red line is when the virtual tour is loading for the first time. You see leefruimte.jpg is downloaded in nine milliseconds. After transportation (under the red line), leefruimte.jpg is downloaded again, but now in twelve milliseconds.

I'm accepting that the image leefruimte.jpg was taken from the loaded image in scene zero and was cached.

Also the images navigationCircle.png and focusspot.png, wouldn't be preloaded.

What I have tried:

See text above:

<Pano style={{ display: 'none' }} source={asset(`360/${this.thePanoImage}`)} />

推荐答案

{ this .thePanoImage}`}} />
{this.thePanoImage}`)} />





但它没有看到这张图片。



红线以上i当虚拟导览第一次加载时。你会看到 leefruimte.jpg 是在9毫秒内下载的。运输(在红线下) leefruimte.jpg 再次下载,但现在在12毫秒内。



我接受图像 leefruimte.jpg 是从场景零中加载的图像中取出并缓存的。



图片 navigationCircle.png focusspot.png ,不会预先加载。



我尝试过:



见上文:





But it doesn't see on this image.

Above the red line is when the virtual tour is loading for the first time. You see leefruimte.jpg is downloaded in nine milliseconds. After transportation (under the red line), leefruimte.jpg is downloaded again, but now in twelve milliseconds.

I'm accepting that the image leefruimte.jpg was taken from the loaded image in scene zero and was cached.

Also the images navigationCircle.png and focusspot.png, wouldn't be preloaded.

What I have tried:

See text above:

<Pano style={{ display: 'none' }} source={asset(`360/


{ this .thePanoImage}`)} />
{this.thePanoImage}`)} />


这篇关于如何使用react VR预加载图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆