Is it possible to render a text file or csv file to animate a 3D object?

Hello,

I want to use unity to animate a 3D object, using CFD data collected. I just want to upload or enter some points, maybe 30,000 records, (x,y,z data points) and have it rendered to see what they represent in terms of an animation. Additionally, my files(.txt or .csv) have x, y, z coordinate and velocity.

Thanks

Yes, you can definitely do this. I’m using CSV’s in a similar way right now and it works fine. Recommend CSVHelper by Josh Close. It’s fast and easy to use.

Thank you for your comment. If you are possible, could you tell more details?

This should help.

To save yourself a lot of headaches, you should make sure the .csv has a simple and consistent layout with column labels.

You have to create a struct or class with a matching layout. So whatever order your { X, Y, Z, Vel } order is in the colums of your .csv, you’ll need to create exactly the same layout with the same names for each property.

So your class might be called “My_CSV”

You just add properties to the class that match your .csv layout, then cast to that class like: GetRecords<My_CSV>(cfdData)

it should return a new My_CSV containing all the data. Then you can just push x, y, z, into a new Vector3, etc, etc…

It actually may be easier to create My_CSV first and try outputting a new .csv, then just reading it back in to see if everything works right. Then you can know for sure that the .csv data you are trying to import matches the layout correctly.