This last recipe in the chapter is probably also the most advanced in the entire book, but it can be used to create an impressive effect.
In this recipe, we define our own generated 3D object, not based on cubes or other existing shapes. To obtain this result, we define a very basic geometry that we used to build a custom shape.
The starting setup is similar as before. We will define a new class to hold our graph. So copy any of the previous recipes, but remove all references to
Graph3D and the data from it.
The idea here is to plot a three-dimensional function:
y = (sin(x)² . cos(z)²) / (5 . x² . z²)
Vector3Dclass to clean up some of the code.