5.46. Quad (media-object)

<quad> ‐ A four-point quadrilateral

5.46.1. Attributes

NameTypeDefaults
idIDNone (required)
x1FLOAT0.0
y1FLOAT0.0
z1FLOAT0.0
r1FLOAT1.0
g1FLOAT1.0
b1FLOAT1.0
a1FLOAT1.0
x2FLOAT0.0
y2FLOAT0.0
z2FLOAT0.0
r2FLOAT1.0
g2FLOAT1.0
b2FLOAT1.0
a2FLOAT1.0
x3FLOAT0.0
y3FLOAT0.0
z3FLOAT0.0
r3FLOAT1.0
g3FLOAT1.0
b3FLOAT1.0
a3FLOAT1.0
x4FLOAT0.0
y4FLOAT0.0
z4FLOAT0.0
r4FLOAT1.0
g4FLOAT1.0
b4FLOAT1.0
a4FLOAT1.0

5.46.2. Description

This element defines a four-point quadrilateral.

The float values of the x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, and z4 attributes define the coordinates of the four vertices of the quadrilateral. The float values of the r1, g1, b1, a1, r2, g2, b2, a2, r3, g3, b3, a3, r4, g4, b4, and a4, attributes define the colors of the four vertices of the quadrilateral. This element can have elements in its scope that define the properties of the quad: color, material, materialRaytrace, shader, texture, or video.

5.46.3. Expected children

The following elements can occur in quad: color, material, materialRaytrace, shader, texture, or video.

5.46.4. Example

The example below defines a textured plane quad with black opaque colors a each edge. The combination of color and texture is useful for blending textures and colors through transparency.

<quad id="quad_{#nbElts}" x1="0.0" y1="0.25" z1="0.0"
                        r1="0.0" g1="0.0" b1="0.0" a1="1.0" 
                        x2="1.0" y2="0.25" z2="0.0"
                        r2="0.0" g2="0.0" b2="0.0" a2="1.0" 
                        x3="1.0" y3="0.0" z3="0.0" 
                        r3="0.0" g3="0.0" b3="0.0" a3="1.0" 
                        x4="0.0" y4="0.0" z4="0.0" 
                        r4="0.0" g4="0.0" b4="0.0" a4="1.0" > 
  <texture encoding="pnga" env_mode="blend_fragment"
                        mipmapped="true"
                        xlink:href="textures/word{#n}-1.png"
                        id="ground_metal" tile_s="-1" tile_t="-1" /> 
</quad>