Unity Tutorial and Troubleshooting on Visualizing Point Cloud Data in VR

By: Mandy He (2022)

Unity Experience Expected: None
Note: This tutorial expects that you have already downloaded Unity

Step 1: Set up a new Unity Project for VR 

NOTE: Steps 2-7 are based off this tutorial. If you have no Unity experience, I suggest that you follow that tutorial because it spends time explaining why you do each step

Step 2: DataBall Prefab

Create a prefab:

Step 3: CSV Reader

Create a script called CSVReader and copy paste this code from here into the script.

Step 4: Import CSV Data

Create a folder called Resources and then store your CSV data there (aka. the data you want to visualize). The tutorial supplies you with a cleaned up dataset. Download here: iris.csv

Step 5: DataPlotter

Create a script called DataPlotter and copy paste this code from here into the script. Note that you may need to adjust some values depending on your dataset and the values of your dataset.

Step 6: Point Holder

Create an empty GameObject called PointHolder. 

Delete the sphere from the Hierarchy

Step 7: Plotter

Create another empty GameObject called Plotter

Make the DataPlotter script a component of the Plotter GameObject.

Then drag the Databall prefab into the Point Prefab slot and the PointHolder GameObject into the Point Holder slot. (You will see the slot glow blue when you try to fill it with something).

Make sure to make the inputfile the name of your data file (whatever it is saved as in your resources folder)

Change Column X to 1, Column Y to 2 and Column Z to 3. (Note that this is because "0" is the index of the point but we want the actual locations of the point along the x, y, and z axis

Press the play button and after shifting around a bit you should see what is in the picture at the left.


Here are some potential tips and answers to potential questions to guide you through the scatterplot tutorial: