<revolution> ‐ A revolution surface generated by the rotation of a Bezier curve around an axis
This element defines a revolution surface generated by the rotation of a Bezier curve around an axis. Figure 5-16 shows a graphical rendering of a revolution defined by one four-point Bezier curve.
The integer value of the segments attribute is the number of stacks and the integer value of the angularStep attribute is the number of slices that will be used to build the mesh of the revolution surface when rendering it.
The string value of the texturing_mode attribute defines the projection of the texture on the revolution surface. The normal and the vertical values correspond to cylindrical projection with a 90 degrees rotation of the texture for the vertical mode, and the radial value corresponds to a projection parallel to the surface symmetry axis (see Figure 5-17).
This element can have elements in its scope that define the properties of the revolution: color, material, materialRaytrace, shader, texture, or video. In addition to these optional elements, it must have one Bezier curve as child element that defines the geometry of the revolution.
The following elements must occur in revolution: one Bezier curve and, possibly, color, material, materialRaytrace, shader, texture, or video.
The example below defines a textured revolution generated by one 4-point Bezier curve.
<node id="revol_1"> <revolution id="node_revolution" segments="50" angularStep="2.0" texturing_mode="radial" > <texture encoding="pnga" bmipmapped="true" env_mode="blend_fragment" xlink:href="textures/OKJimsonWeed.png" id="ground_metal" tile_s="1" tile_t="1" /> <bezier size="4" x1="1.35748" y1="-100" z1="0.00" x2="-1.49606" y2="5.37" z2="0.00" x3="1.677" y3="-0.76" z3="0.00" x4="6.1" y4="1.18" z4="0.00" /> </revolution> </node>
The attribute values of the Bezier curve that define a revolution can be accessed through the sequence node:attribute in which node is the revolution node ID and attribute is the curve attribute.
The example below prints the y2 attribute of the Bezier curve in the revolution named node_revolution.
<action> <write_console value="Bezier in y2 ({$node_revolution:y2})" /> </action>