加载 webvr 场景时黑屏
Blank screen when loading webvr scene
我有一个如下的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.
我有一个如下的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.