Accelerometer data in 3dsmax
I wrote a new maxscript that imports data from the Android app Accelerometer Monitor by Mobile Tools
This script was inspired by John Rand's work: CSV 2 Keys and has some borrowed code from Bobo.
Just drag and drop the script to 3dsmax and you will find in the "3idee tools"-category.
Setting up and running Accelerometer..
Download and install the app on your Android phone. Now run the app and go to settings. Change the following settings:
- Remove Earth Gravity = on
- Sensor speed Slowest. Try this speed first, it works very well with handheld movements.
- Set the File name
The higher the speed, the more jitter you will get in the movements.
Now go and save the movements. What I do is just email the resulting TXT file to myself.
Now open the TXT file in Wordpad and remove all the lines that do not contain 4 values. That is the first 5 lines and the last 2 lines.
Save the file.
Running the maxscript..
Drag and drop the acc_app_reader.ms to 3dsmax. Now go to Customize user interface, and find the category "3idee tools". Drag the script to a toolbar and press it!
The following floater will appear:
There are 6 import speeds:
- Real values will take the exact values from the forth column of the TXT file. As you can see in the previous image those values vary a bit. (217,210,209,219,211,210)
- Fastest through slowest puts the keys at exactly 10,30,70 and 210ms apart.
- Keyframed will ignore any in between time and just puts every position exactly on a keyframe.
Real values through Slowest will result in keys being positioned in between timeframes. You can however collapse the movement in the motion tab with a certain sample range in 3dsmax.
The scale value will scale all the values in the TXT file.
Press the "Get to da choppa!!" button and select your modified TXT file. After import just attach any stuff to the point-helper to get some fun results. (particles, cloth and so on....)
The script will change the animation range automatically.
Cumulative adds up all the values and thus will represent the movement more properly. Relative sets the captured values in the position and will show you the "vibrations" of the phone. Some more explained in the below video:
In the video I am moving the phone from left to right with a little pause at the ends.
If "Start at 0,0,0" is checked the helper will start at 0,0,0 in world space at time zero.
The presicion spinner allows you to round up the values of the TXT file.
Also added is a keyframe reducer. The value is the accuracy of the reducer; since most noise happens between 0 and 0.5-ish range I set the default on 0.5 If you need more accuracy, you lower the number. The interval number is the time step the reducer will sample at. The lower the number the less time between the steps, and thus you will get more noise.
Next up, I asked the developer of the Android app to incorporate the azimuth, pitch and roll values, so I can grab the orientation as well. We'll see though...