如何创建带缩放功能的 <a-sky></a-sky> 图像?
How to create a <a-sky></a-sky> image with zoom?
我是a-frame新手,有一个简单的问题(其实对我来说很难)
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
<a-scene>
<a-assets>
<img id="sky" src="http://aprinweb.ir/vr/img/monument.jpg">
</a-assets>
<!-- <a-light type="spot" color="#ff0000" position="0.13 1.31 -1.18" look-at="a-box"></a-light> -->
<a-sky src="#sky"></a-sky>
</a-scene>
我昨晚构建了这个示例,我需要为这个天空标签插入缩放(因为我需要创建一个类似虚拟旅游的虚拟现实)
如何在框架上创建缩放以放大图片???
感谢您的帮助
最新的aframe(v0.9.0)已经支持该功能。您需要通过将以下内容添加到您的 <a-scene>
标签来使用相机标签。
<a-entity camera look-controls position="0 1.6 0" id="camera-id"></a-entity>
将使用新添加的摄像头,而不是系统默认的摄像头。在您的代码中,执行与此类似的操作:
var camera = document.querySelector('#camera-id');
camera.setAttribute('camera', 'zoom', your_zoom_factor);
有关详细信息和示例,请参阅 https://github.com/aframevr/aframe/blob/master/docs/components/camera.md。
我是a-frame新手,有一个简单的问题(其实对我来说很难)
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
<a-scene>
<a-assets>
<img id="sky" src="http://aprinweb.ir/vr/img/monument.jpg">
</a-assets>
<!-- <a-light type="spot" color="#ff0000" position="0.13 1.31 -1.18" look-at="a-box"></a-light> -->
<a-sky src="#sky"></a-sky>
</a-scene>
我昨晚构建了这个示例,我需要为这个天空标签插入缩放(因为我需要创建一个类似虚拟旅游的虚拟现实) 如何在框架上创建缩放以放大图片??? 感谢您的帮助
最新的aframe(v0.9.0)已经支持该功能。您需要通过将以下内容添加到您的 <a-scene>
标签来使用相机标签。
<a-entity camera look-controls position="0 1.6 0" id="camera-id"></a-entity>
将使用新添加的摄像头,而不是系统默认的摄像头。在您的代码中,执行与此类似的操作:
var camera = document.querySelector('#camera-id');
camera.setAttribute('camera', 'zoom', your_zoom_factor);
有关详细信息和示例,请参阅 https://github.com/aframevr/aframe/blob/master/docs/components/camera.md。