[Edu-sig] A bit o Python in Physics

Kirby Urner urnerk at qwest.net
Tue Nov 25 00:55:32 EST 2003


So this Nebraska-based physics prof I met gets these volunteers to jump,
run, leap, with like 25 wireless motion sensors taped on, which generate
data somehow.  

He sends me these huge spreadsheets full of x,y,z positions for each sensor.

So Python comes in handy to parse the data, translate it to POV-Ray, and
trigger a rendering of each row from the spreadsheet into a frame (a bmp in
Windows).  

bmp2avi.exe makes a movie, and avi2mpg1.exe makes the movie small enough to
share (1.5MB vs. 250MB).

Examples at:
ftp://ftp.4dsolutions.net/pub

I just thought I'd toss in a code snipped because it's kind of humorous:
"knee bone connected to the ankle bone" kinda stuff (if you know the song I
mean [1])

        self.draw('L.Shoulder','Offset')        
        self.draw('L.Shoulder','L.Elbow')
        self.draw('L.Shoulder','L.Asis')        
        self.draw('L.Elbow','L.Wrist')
        self.draw('V.Sacral','L.Asis')
        self.draw('V.Sacral','L.Thigh')        
        self.draw('L.Asis','L.Thigh')
        self.draw('L.Asis','L.Knee')         
        self.draw('L.Thigh','L.Knee')
        self.draw('L.Knee','L.Shank')
        self.draw('L.Knee','L.Ankle')        
        self.draw('L.Thigh','L.Shank')                
        self.draw('L.Shank','L.Ankle')
        self.draw('L.Ankle','L.Heel')
        self.draw('L.Heel','L.Toe')
        self.draw('L.Ankle','L.Toe')                
        
http://www.gospel.mcmail.com/a-g/dry_bones.htm

Kirby





More information about the Edu-sig mailing list