Accelerometer data in 3dsmax

Intro..
 

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:

http://www.youtube.com/watch?v=TDzcnbzmK2s&feature=player_embedded 

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.

Download the updated script here.

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...

Comments

martincg's picture

Realtime

Nice idea...next step is make it realtime, if it is possible. I can also imagine if it is possible to make it through network for reviewing design from client.

barneyproductions's picture

this is great.. it works

this is great.. it works perfectly on some text files.. however on others it fails, "Unable to convert: undefined to type: Float"

Any idea why this might be?

Royal Ghost's picture

Nice attempt!

Nice attempt! I'm searching for something like this tool but for Android and found your script. I made some tests and found it's not so bad.  I'd be looking forward to update and more news. Thank you for sharing. Smile

p.s. Why not just skip empty strings and strings with # symbol when reading .txt file?

Royal Ghost | veda3d.com

barigazy's picture

Nice stuff

Very interesting solution,Michiel.
Cheers!

bga

JokerMartini's picture

true.This is very clever and

true.This is very clever and cool.

John Martini
Digital Artist
http://www.JokerMartini.com (new site)