5.7. Circle (media-object)

<circle> ‐ A horizontal circle (parallel to the xOz plane).

5.7.1. Attributes

NameTypeDefaults
idIDNone (required)
radiusFLOATNone (required)
xFLOAT0.0
yFLOAT0.0
zFLOAT0.0
segmentsINTEGERNB_ITERATIONS_BEZIER (100)
widthFLOAT1.0

5.7.2. Description

This element defines a circle parallel to the xOz plane. It is used either as an autonomous geometrical component in a scene, or as a circular path in a circle transformation.

The float values of the x, y, and z attributes define the coordinates of the circle center P. This element must have a radius attribute with a float value R. It defines a horizontal circle (parallel to the xOz plane) centered at P with radius R. The float value of the width attribute defines the width of the circle (a circular crown); it must be set to 0 for an invisible circle. The integer value of the segments attribute is the number of steps that will be used to build the mesh of the circle when rendering it.

5.7.3. Expected child

None.

5.7.4. Example

The example below defines a circle centered at (0.0, 0.6, 8.0) with radius 3.0 and width 1.0. It is drawn in 100 steps and has material properties.

<node id="circle 1 ">
  <circle id="circle_#1" segments="100" radius="3.0" 
          x="0.0" y="0.6" y="8.0" width ="1.0" >
    <material id="silver">
      <ambient r="0.19225" g="0.19225" b="0.19225" a="1.0"/>
      <diffuse r="0.5075" g="0.5075" b="0.5075" a="1.0"/>
      <specular r="0.50827" g="0.50827" b="0.50827" a="1.0"/>
      <emission r="0.0" g="0.0" b="0.0" a="1.0"/>
      <shininess s="51.2"/>
    </material>
  </circle>
</node>