Explanation of the c3d file format

Yvan Scher
2 min readFeb 4, 2018

--

A quick reference for anyone new to the format.

If you are still reading this on medium I moved my blog to http://yvanscher.com/blog.html

Recently I was working with some .c3d files and I didn’t seem to be able to find a whole lot of information on how to read, and understand them. Here is what I’ve found so far.

Data

If you read the file with the c3d python package (below) You’ll find the data probably has 2 sections, the 3D point data and the analog data.

The 3D point data is 5D for each data point in the animation. The first three values are usually x,y,z in 3D space. The next two values are the error estimate (not sure what this means) and the number of cameras that registered this point (which should be a singluar value, like 3, 4, 5,).

The analog data was difficult to figure out. I ended up just emailing one of the people who created the file format. This data can be anything that goes along with the 3D point data. For example it could be a measure of force or mean body temperature in each frame. This data often stored at a different rate than the 3D point data. The thing to remember is that this is not location data in 3D space. According to the creator of the format: Typical analog data in biomechanics contains force plate signals, EMG data, accelerometer data, and foot switch information for gait timing.

Data examination

We’ll use the c3d package in python to read a c3d:

Above we’ve downloaded the first sample file on the page: sample01.zip. Then we took the first .c3d file in that zip called Eb015pi.c3d and created a reader with it. Then we used the read_frames method which is a generator that produces the frame number, the 3d points for that frame, and the analog data from the points in that frame. the output looks something like this:

So each frame of the animation is printed, each frame has 26 datapoints (3 xyz, residual value, cameras value) located inside point, each frame also has 16 points of analog data (4 values), which can be anything.

Useful Resources

https://pypi.python.org/pypi/c3d — A python package you can use to read most .c3d files programatically. It was written by The Embodied Cognition Lab at UT Austin! It has a github with usage.

https://www.blender.org — A free 3d modelling and animation software that can be used do import .c3d files. It is not enabled by default. Go to File -> User Preferences -> Then check the box next to ‘Import-Export: C3D Graphics Lab Motion Capture file (.c3d)’

https://isbweb.org/software/movanal/C3D/C3Dmanual.pdf — The C3D manual.

https://books.google.com/books?id=pskqBgAAQBAJ&pg=PA181&lpg=PA181&dq=c3d+analog+data&source=bl&ots=Y06JBiQ1AH&sig=zTrvyV6MM05EGoKXKTvrFn1GnTA&hl=en&sa=X&ved=0ahUKEwiqrL7374rZAhXrs1kKHVITCNYQ6AEITzAG#v=onepage&q=c3d%20analog%20data&f=false — This book was useful. It’s called MoCap for Artists and gives a not too technical overview of different file formats including C3D.

That’s it for now. I’ll update and improve this doc as I learn more.

--

--