What about round surfaces, such as spheres are they triangle meshes too?
Go back to the
WireframeShapes
class you just created.Comment out the line that creates the
Box()
mesh.Replace the box mesh with code that creates a sphere mesh instead. Use the Sphere class from the
com.jme3.scene.shape
package:Sphere mesh = new Sphere(16, 16, 1.0f);
This line of code creates a sphere mesh with a radius of 1.0f. The other arguments of the constructor specify the smoothness of the sphere.
Run the class. Move around using the W, A, S, and D keys and the mouse, and inspect the polygon mesh that outlines the shape of the sphere.
When you run the sample application, you realize that even a sphere is quite a triangular business, from the point of view of a 3D engine!
The quality of a sphere is determined by its radial samples; that is, the number of triangles along the equator and meridian of the sphere. This is why the sphere constructor takes...