如何解决我正在制作一个带有框架的网络 VR 游戏,但它冻结了
我对不同 ide 的所有尝试都没有奏效。相反,他们冻结……………… 这是我的代码。
<!DOCTYPE html>
<html>
<head>
<script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
<style>
</style>
</head>
<body>
<a-scene>
<a-entity>
<a-sphere
position="6 1 5"
depth="6"
height="556"
width="5"
animation="
property: roatate;
from: 5 0 0;
to: 0 360 0;
dur: 2000;
easing: nonlinear;
loop: true"
color="blue">
</a-sphere>
</a-entity>
</a-scene>
</body>
</html>
解决方法
您的代码几乎没有问题:
- 主要是错别字旋转而不是旋转
animation="property: 旋转;...
- a-sphere> 没有深度、高度和宽度等属性。只有半径。您可能可以使用缩放来改变它的形状。
- 没有非线性类型的缓动。有关可用缓动的完整列表,请参阅 this documentation page
缓动:非线性;
在下面找到工作示例
<!DOCTYPE html>
<html>
<head>
<script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
<style>
</style>
</head>
<body>
<a-scene>
<a-entity>
<a-sphere
scale="1 2 3"
position="6 1 5"
animation="
property: rotation;
from: 5 0 0;
to: 0 360 0;
dur: 2000;
easing: linear;
loop: true"
color="blue">
</a-sphere>
</a-entity>
</a-scene>
</body>
</html>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。