3D Surface Plotter  1.0.0
Create 3D Surface Charts for Any Math Function
Get Started

Importing Library

In order to use the Surface3DLib library, you need to import it into your Unity project. Simply open the Asset Store window and importing the 3D Surface Plotter package. The library is located in the 3D Surface Plotter/Plugins folder:

You can see there are two files in the Plugins folder: Surface3DLib.dll and Surface3DLib.xml. The former is the class library file and the latter is the xml file used for IntelliSense in Visual Studio. In practice, your Unity project only needs these two files to create 3D surface plots. You can place these two files inside your project where you wish. However make sure you place them in the same folder.

Materials (Optional)

To test this library, you need to use a material that supports vertex color and two-side lighting. In the 3D Surface Plotter/Materials folder, we define two materials: Surface3DMaterial and TextureMaterial, as shown in the following image:

Clicking on the Surface3DMaterial will bring up the Surface 3D Material window in the Inspector:

You can see that this material uses the Particles/Standard Surface shader and the Two Sided property is checked. This is because the Unity's built-in Particles/Standard Surface shader supports vertex color and two-sided rendering. Using this material is not required, you can create your own shader as long as it supports vertex color and two-side rendering.

The TextureMaterial is used to map image textures onto the 3D surface because our library also generates the UV coordinate data for the surface. The following figure shows the Texture Material window in the Inspector:

This material uses a legacy specular shader that allows you to select an image for the texture mapping. In the 3D Surface Plotter/Textures folder, we include several images that you can use to test the texture mapping on the 3D surfaces:

Camera Control (optional)

The 3D Surface Plotter/Scripts folder contains a CameraOrbit.cs file. This file can be attached to the MainCamera object in a scene, as shown in the following figure:

This allows you to rotate, pan, and zoom the GameObject with your mouse in the game play mode. This camera control is optional, you can use whatever camera you like.

With this preparation and setup, we will show you how to use the Surface3DLib library to create several demo examples in the following sections.