[英]How to draw a curve in A-frame?
我正在开始使用A-Frame,这是一个非常基本的问题。 我检查了许多示例以绘制一条线,然后在A-Frame中绘制一条曲线,但是它们没有出现在场景中。 我那里有一架飞机,可以正确显示。
我可以使用document.querySelector('a-plane').object3D;
获取飞机但是document.querySelector('a-curve').object3D;
返回未定义。
这是一个代码示例:
<!DOCTYPE html>
<html>
<head>
<title>A-frame room</title>
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"> </a-plane>
<a-sky color="#ffffff"></a-sky>
<a-curve type="CatmullRom" curve="closed:true" visible="true">
<a-curve-point id="checkpoint1" position="0 0 -4" visible="true"></a-curve-point>
<a-curve-point id="checkpoint2" position="0 10 -4" visible="true"></a-curve-point>
<a-curve-point id="checkpoint3" position="0 10 -8" visible="true"></a-curve-point>
<a-curve-point id="checkpoint4" position="0 0 -8" visible="true"></a-curve-point>
</a-curve>
</a-scene>
</body>
</html>
您需要导入提供<a-curve>
的JS组件。 这是社区的组成部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.