Using Spheres
-
Prerequisite
Introduction
Besides boxes, the next most commonly used shape in 3D scenes is the Sphere. Spheres can be added using the add sphere block from the 3D Object category:
Parameters
Color
You can set the color of the sphere by clicking on the color input.
Size in x/y/z
These 3 numbers control the size of the sphere in each direction. For example, the following program adds an oval shape that is taller along the Z-axis:
Arc
The “arc” value allows us to show a portion of a sphere, just like how you can peel off some sections of an orange:
For example, the following picture shows the difference between arc values of 100, 75, 50, 25 and 5:
Slice
The “slice” value allows us to vertically cut off a portion of a sphere, just like how you cut lemon slices:
For example, the following picture shows the difference between slice values of 100, 75, 50, 25 and 5:
Sides
A sphere is approximated by many small triangles, and the “sides” value controls how many such triangles are used. The more sides, the smoother the sphere looks, but it would also take the game engine more time to draw these triangles. For example, the following picture shows the difference between sides values of 2, 4, 8, 16 and 32.
For most situations, you can use sides of 8 or 16 to reduce the computations. If you are including a very large sphere in your scene, then you will need to use more sides to make it smooth.
Demo
When you set both the arc and slice to less than 100, you can get some interesting shapes.
For example, with arc of 25 and slice of 50, you get a flying carpet:
On the other hand, with arc of 50 and slice of 25, you get a face mask:
-