Cylinders Are Useful

Cylinder • Attributes

Three colored cylinders with differing height and radius.

You can create cylinders of any radius or length but to make a cylinder that bends, such as a curved pipe, requires either an Extrusion with a circular cross-section or a mesh (compound set of objects).

 

Rotate the vrignette to view the geometry.

<x3d>

<scene>

<!-- World Info -->
<worldInfo title="X3D Cylinder Example">
</worldInfo>

<!-- Navigation Info -->
<navigationInfo headlight="true">
</navigationInfo>


<!-- Avatar Viewpoint -->
<viewpoint position="0.0 1.0 20.0" centerOfRotation="0.0 0.0 0.0">
</viewpoint>

<!-- Shapes -->
<transform rotation="1 1 1 0.785">
<shape>
<appearance>
<material diffuseColor="0.0 0.749 0.0" specularColor="0.15 0.15 0.15" shininess="0.20">
</material>
</appearance>
<cylinder bottom="true" top="true" height="7.0" radius="0.75" side="true" solid="false">
</cylinder>
</shape>
</transform>

<transform translation="-5.0 1.0 -3.0" rotation="1 1 1 0.785">
<shape>
<appearance>
<material diffuseColor="0.749 0.0 0.749" specularColor="0.15 0.15 0.15" shininess="0.20">
</material>
</appearance>
<cylinder bottom="true" top="true" height="5.0" radius="0.30" side="true" solid="false">
</cylinder>
</shape>
</transform>

<transform translation="4.0 -1.0 3.0" rotation="1 1 1 0.785">
<shape>
<appearance>
<material diffuseColor="0.0 0.376 0.749" specularColor="0.15 0.15 0.15" shininess="0.20">
</material>
</appearance>
<cylinder bottom="true" top="true" height="4.0" radius="0.40" side="true" solid="false">
</cylinder>
</shape>
</transform>

<!-- Scene Background -->
<background skyColor="0.20 0.20 0.20" groundColor="0.20 0.20 0.20">
</background>

</scene>
</x3d>