Back to Aframe

A Triangle

docs/primitives/a-triangle.md

1.7.15.8 KB
Original Source

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

Example

html
<a-scene>
  <a-assets>
    
  </a-assets>

  <!-- Basic triangle. -->
  <a-triangle color="#CCC" vertex-c="1 -1 0"></a-triangle>

  <!-- Textured triangle parallel to ground. -->
  <a-triangle src="#platform" rotation="-90 0 0"></a-triangle>
</a-scene>

Attributes

AttributeComponent MappingDefault Value
alpha-testmaterial.alphaTest0
ambient-occlusion-mapmaterial.ambientOcclusionMapNone
ambient-occlusion-map-intensitymaterial.ambientOcclusionMapIntensity1
ambient-occlusion-texture-offsetmaterial.ambientOcclusionTextureOffset0 0
ambient-occlusion-texture-repeatmaterial.ambientOcclusionTextureRepeat1 1
anisotropymaterial.anisotropy0
blendingmaterial.blendingnormal
colormaterial.color#FFF
depth-testmaterial.depthTesttrue
depth-writematerial.depthWritetrue
displacement-biasmaterial.displacementBias0.5
displacement-mapmaterial.displacementMapNone
displacement-scalematerial.displacementScale1
displacement-texture-offsetmaterial.displacementTextureOffset0 0
displacement-texture-repeatmaterial.displacementTextureRepeat1 1
ditheringmaterial.ditheringtrue
emissivematerial.emissive#000
emissive-intensitymaterial.emissiveIntensity1
env-mapmaterial.envMapNone
flat-shadingmaterial.flatShadingfalse
mag-filtermaterial.magFilterlinear
material-fogmaterial.fogtrue
material-visiblematerial.visibletrue
metalnessmaterial.metalness0
metalness-mapmaterial.metalnessMapNone
metalness-texture-offsetmaterial.metalnessTextureOffset0 0
metalness-texture-repeatmaterial.metalnessTextureRepeat1 1
min-filtermaterial.minFilterlinear-mipmap-linear
normal-mapmaterial.normalMapNone
normal-scalematerial.normalScale1 1
normal-texture-offsetmaterial.normalTextureOffset0 0
normal-texture-repeatmaterial.normalTextureRepeat1 1
offsetmaterial.offset0 0
opacitymaterial.opacity1
repeatmaterial.repeat1 1
roughnessmaterial.roughness0.5
roughness-mapmaterial.roughnessMapNone
roughness-texture-offsetmaterial.roughnessTextureOffset0 0
roughness-texture-repeatmaterial.roughnessTextureRepeat1 1
shadermaterial.shaderstandard
sidematerial.sidefront
spherical-env-mapmaterial.sphericalEnvMapNone
srcmaterial.srcNone
transparentmaterial.transparentfalse
vertex-ageometry.vertexA0 0.5 0
vertex-bgeometry.vertexB-0.5 -0.5 0
vertex-cgeometry.vertexC0.5 -0.5 0
vertex-colors-enabledmaterial.vertexColorsEnabledfalse
wireframematerial.wireframefalse
wireframe-linewidthmaterial.wireframeLinewidth2

Parallelizing to the Ground

To make a triangle parallel to the ground, rotate it around the X-axis:

html
<a-triangle rotation="-90 0 0"></a-triangle>