Webots Reference Manual

previous page go up next page

Thanks

1. Introduction

2. Node Chart

3. Nodes and API Functions

4. Motion Functions

5. Prototypes

6. Physics Plugin

7. Fast2D Plugin

8. MTN Functions

9. Webots World Files

10. Other APIs

     

3.40 Sphere

Sphere { 
  SFFloat   radius        1   # (-inf,inf)
  SFInt32   subdivision   1   # [0,inf)
}

The Sphere node specifies a sphere centered at (0,0,0) in the local coordinate system. The radius field specifies the radius of the sphere (see figure 3.25). The Sphere node's geometry requires outside faces only. When viewed from the inside, the results are undefined. The Sphere node cannot be textured.

If radius is positive, the outside faces of the sphere are displayed while if it is negative, the inside faces are displayed.

sphere

Figure 3.25: Sphere node

The VRML97 Sphere node was extended to include a subdivision field which controls the shape of the rendered sphere. Spheres are rendered as icosaedrons with 20 faces when the subdivision field is set to 0. If the subdivision field is 1 (default value), then each face is subdivided into 4 faces, making 80 faces. With a subdivision field set to 2, 320 faces will be rendered, making the sphere very smooth. A maximum value of 5 (corresponding to 20480 faces) is allowed for this subdivision field to avoid a very long rendering process. A value of 10 will turn the sphere appearance into a black and white soccer ball.

When a texture is applied to a sphere, the texture covers the entire surface, wrapping counterclockwise from the back of the sphere. The texture has a seam at the back where the YZ plane intersects the sphere. TextureTransform affects the texture coordinates of the Sphere.

previous page go up next page
^ page top ^

  E-mail to webmaster Last updated: Copyright © 2010 Cyberbotics Ltd.