gpt4 book ai didi

javascript - 加载 webvr 场景时出现黑屏

转载 作者:行者123 更新时间:2023-12-01 02:37:50 25 4
gpt4 key购买 nike

我有一个如下的 webvr 场景,但是加载场景时,屏幕是空白的。只有当鼠标在场景中移动时,场景才会出现。

<a-scene id="exp-view" style="width: 90vw; height: 90vh;" embedded>
<a-assets>
<a-asset-item id="endo-obj" src="test.obj"></a-asset-item>
</a-assets>
<a-entity position="33 0 -33" rotation="0 180 0" look-controls id="camera" camera="userHeight: 1.6" listener>

<a-grid static-body></a-grid>

<a-box color="#a00" scale="0.3 0.3 0.3" rotation="-90 180 0" dynamic-body="shape: box; mass: 0" position="-10 0 20" width="2" height="2" depth="2"></a-box>

<a-box color="#abc" position="-35 0 0" width="0.001" height="6" depth="70"></a-box>
<a-box color="#abc" position="35 0 0" width="0.001" height="6" depth="70"></a-box>

<a-box color="#abc" position="0 0 -35" width="70" height="6" depth="0.001"></a-box>
<a-box color="#abc" position="0 0 35" width="70" height="6" depth="0.001"></a-box>

<a-light type="ambient" color="#bbb"></a-light>
<a-light color="#ccc" position="0 30 0" distance="100" intensity="0.4" type="point"></a-light>
<a-light color="#ccc" position="3 10 -10" distance="50" intensity="0.4" type="point"></a-light>
<a-entity id="a" template="src: #scene1"></a-entity>
</a-scene>

这是一个物体很少的场景。但是,只有在用户提供一些输入(例如用鼠标拖动场景)后,它才会可见。如何直接展示这个场景?

最佳答案

使用 </a-entity> 关闭您的相机实体标签,并确保您的模型正确加载(源路径正确)。

似乎是working .

关于javascript - 加载 webvr 场景时出现黑屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47759431/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com