Google VR查看错误 - 无法从ffff.jpg加载纹理

时间:2022-03-31 04:59:00

This is my index.html file

这是我的index.html文件

<html>
<head>
  <title>VR Sample</title>
  <script src="//storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>

</head>

<body>

  <div id="vrview">
    <iframe width="100%"
    height="300px"
    allowfullscreen
    frameborder="0"
    src="http://storage.googleapis.com/vrview/index.html?image=ffff.jpg&is_stereo=true">
</iframe>
  </div>



</body>
</html>

And this is the structure of the website folder

这是网站文件夹的结构

Google VR查看错误 - 无法从ffff.jpg加载纹理

I tried hosting it in Webserver for chrome as per the instructions in the google codelabs. But I clicked the 127.0.0.1.8887 url, I got a blank page with no files or folders. Then I tried hosting it on XAMPP and It did work. However, I did not get the panaroma image. Instead I got this error

我尝试按照谷歌代码中的说明在Webserver中托管它。但是我点击了127.0.0.1.8887网址,我得到了一个没有文件或文件夹的空白页面。然后我尝试在XAMPP上托管它,它确实有效。但是,我没有得到panaroma图像。相反,我得到了这个错误

Google VR查看错误 - 无法从ffff.jpg加载纹理

I took the 360 image with google camera app and converted it to stereo with the google's online converter but got the same error. I also tried downloading the VRView repo from github and modified the code as

我用谷歌相机应用程序拍摄360度图像并使用谷歌的在线转换器将其转换为立体声,但得到了同样的错误。我也尝试从github下载VRView repo并将代码修改为

src="vrview/index.html?image=ffff.jpg&is_stereo=true"

that too didn't work.

那也没有用。

1 个解决方案

#1


3  

You are using the iframe version of vrview meaning when you request "ffff.jpg", you are actually requesting:

您正在使用iframe版本的vrview意思是当您请求“ffff.jpg”时,您实际上是在请求:

http://storage.googleapis.com/ffff.jpg

http://storage.googleapis.com/ffff.jpg

Try using the javascript version

尝试使用javascript版本

Try this:

尝试这个:

<html>
<head>
   <script src="http://storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>
   <script>
      window.addEventListener('load', onVrViewLoad)
      function onVrViewLoad() {
         var vrView = new VRView.Player('#vrview', {
         image: 'http://storage.googleapis.com/vrview/examples/coral.jpg',
         is_stereo: true,
         width: '100%',
         height: 300
      });
   }
</script>
</head>
<body>
   <div id="vrview"></div>
</body>
</html>

Note: chrome cannot access files off a harddrive.

注意:chrome无法访问硬盘上的文件。

#1


3  

You are using the iframe version of vrview meaning when you request "ffff.jpg", you are actually requesting:

您正在使用iframe版本的vrview意思是当您请求“ffff.jpg”时,您实际上是在请求:

http://storage.googleapis.com/ffff.jpg

http://storage.googleapis.com/ffff.jpg

Try using the javascript version

尝试使用javascript版本

Try this:

尝试这个:

<html>
<head>
   <script src="http://storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>
   <script>
      window.addEventListener('load', onVrViewLoad)
      function onVrViewLoad() {
         var vrView = new VRView.Player('#vrview', {
         image: 'http://storage.googleapis.com/vrview/examples/coral.jpg',
         is_stereo: true,
         width: '100%',
         height: 300
      });
   }
</script>
</head>
<body>
   <div id="vrview"></div>
</body>
</html>

Note: chrome cannot access files off a harddrive.

注意:chrome无法访问硬盘上的文件。