当前位置: 首页 > 文档资料 > A-Frame 中文文档 >

<a-plane>

优质
小牛编辑
131浏览
2023-12-01

The plane primitive creates flat surfaces using the geometry component with the type set to plane.

Example

<a-scene>  <a-assets>    <img src="ground.jpg">  </a-assets>  <!-- Basic plane. -->  <a-plane color="#CCC" height="20" width="20"></a-plane>  <!-- Textured plane parallel to ground. -->  <a-plane src="#ground" height="100" width="100" rotation="-90 0 0"></a-plane></a-scene>

Attributes

AttributeComponent MappingDefault Value
ambient-occlusion-mapmaterial.ambientOcclusionMapNone
ambient-occlusion-map-intensitymaterial.ambientOcclusionMapIntensity1
ambient-occlusion-texture-offsetmaterial.ambientOcclusionTextureOffset0 0
ambient-occlusion-texture-repeatmaterial.ambientOcclusionTextureRepeat1 1
colormaterial.color#FFF
displacement-biasmaterial.displacementBias0.5
displacement-mapmaterial.displacementMapNone
displacement-scalematerial.displacementScale1
displacement-texture-offsetmaterial.displacementTextureOffset0 0
displacement-texture-repeatmaterial.displacementTextureRepeat1 1
env-mapmaterial.envMapNone
fogmaterial.fogtrue
heightmaterial.height256
metalnessmaterial.metalness0
normal-mapmaterial.normalMapNone
normal-scalematerial.normalScale1 1
normal-texture-offsetmaterial.normalTextureOffset0 0
normal-texture-repeatmaterial.normalTextureRepeat1 1
repeatmaterial.repeat1 1
roughnessmaterial.roughness0.5
segments-heightgeometry.segmentsHeight1
segments-widthgeometry.segmentsWidth1
spherical-env-mapmaterial.sphericalEnvMapNone
srcmaterial.srcNone
widthmaterial.width512
wireframematerial.wireframefalse
wireframe-linewidthmaterial.wireframeLinewidth2

Parallelizing to the Ground

To make a plane parallel to the ground or make a plane the ground itself, rotate it around the X-axis:

<a-plane rotation="-90 0 0"></a-plane>