【问题标题】:asp.net mvc 360° Media integrationasp.net mvc 360°媒体整合
【发布时间】:2019-12-26 14:31:42
【问题描述】:

我正在尝试将 360° 图像集成到我的网站中。 但它不起作用,有人可以帮助我吗? 提前致谢

当我尝试运行它时,出现如下渲染错误(图片)

我已添加(在标题中): <script src="https://storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>

在视图中我添加了: <div id='vrview'></div>

还有视图中的脚本:

<script> var vrView;

var scenes = {
    petra: {
        image: 'https://localhost:44323/images/Inside/chichen-itza.jpg',
        preview: 'https://localhost:44323/images/Inside/chichen-itza-preview.jpg'
    }
}

function onLoad() {
    vrView = new VRView.Player('#vrview', {
        width: '100%',
        height: 480,
        image: 'https://localhost:44323/images/Inside/chichen-itza-preview.jpg',
        is_stereo: false,
        is_autopan_off: true
    });

    vrView.on('ready', onVRViewReady);
    vrView.on('modechange', onModeChange);
    vrView.on('getposition', onGetPosition);
    vrView.on('error', onVRViewError);
}


function loadScene(id) {
    console.log('loadScene', id);
    // Set the image
    vrView.setContent({
        image: scenes[id].image,
        preview: scenes[id].preview,
        is_autopan_off: true
    });
}

function onVRViewReady(e) {
    console.log('onVRViewReady');
    loadScene('petra');
}

function onModeChange(e) {
    console.log('onModeChange', e.mode);
}

function onVRViewError(e) {
    console.log('Error! %s', e.message);
}

function onGetPosition(e) {
    console.log(e)
}

window.addEventListener('load', onLoad);</script>[![enter image description here][1]][1]`

【问题讨论】:

    标签: asp.net-mvc google-vr 360-panorama-viewer


    【解决方案1】:

    试试这个代码

    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/aframe/1.0.4/aframe.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/3dweb/360javascriptviewer/lib/JavascriptViewer.min.js"></script>
    
    
        <a-scene>
            <img id="panorama" src="~/images/gear-360_overview_bg.jpg"  />
            <a-sky src="#panorama" rotation="0 -90 0"></a-sky>
        </a-scene>
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-21
      • 2019-06-13
      • 2018-05-18
      • 1970-01-01
      • 2011-10-25
      • 2010-10-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多