Previous Blog Next Blog
Prev/Next Blog
by date

Plan for Joseph Greenawalt

Plan for Joseph Greenawalt
Name:Joseph Greenawalt
Date Posted:May 21, 2005
Rating:4.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Joseph Greenawalt

Blog post
My Homebrew 3D Laser Scanner
This is only tenuously related to game development but here goes :) Every couple of years it seems I'm overwhelmed with the desire to work on some kind of crazy mad scientist-esque project. Between the fall and spring semesters I gave in to the urge and created this contraption: home.cablelynx.com/~sgreennawalt/

(Note that the above page was originally created for viewing by a friend of mine, is very unpolished, filled with in-jokes, and skimpy on details)

How it works:

I used a radio shack laser line level to project a vertical red line onto the target object (positioned in the center of the turntable). The turntable is turned by a stepper motor still wired up to the old dot matrix printer that it came out of. When I want to turn the table, I just send out a paper feed escape sequence through the parallel port (feed paper 1/180 of an inch) using a bash shell script. To automate the firing of the camera, I mounted a leaf switch at the edge of the print head's range such that the switch is triggered when the print head is sent to the home position. The leaf switch is connected by two wires to the camera's shutter switch (through a hole drilled in the camera). The shell script feeds the paper (rotates table by small amount), homes the print head (takes picture) and then waits 5 seconds for the picture to be written to the camera's flash memory. The process then repeats until I manually stop it when the turntable has gone 360 degrees (or close enough to). Once the capture process is complete, I use the number of images captured to determine the angle between each "slice". I batch convert all of the images to PPM format (very easy to read) applying some filters to minimize noise. Then I process them with a small c++ program that I wrote which opens each image in order and finds the brightest point on each row of each image. The idea is that since the camera is to the left of the model and facing it at an angle, each point will be displaced more to the right side of the image if it is reflecting off part of the model that is further "foreword" (towards the front of the turn table). I made no attempt to triangulate the points, just stretched the horizontal distance between the points using a series of fudge factors until it looked about right. This process results in a series of 2D slices representing the model which are written to a big text file. I then read the vertices of each slice from the file into blender using a python script, rotating each slice around a vertical axis by an amount corespondent to the actual rotation angle of the turntable. And viola, a 3d-point cloud of a real world object in Blender!

I might put up a more detailed page describing how it works with source code although it is a real mess and I took some terrible shortcuts in the 3d math. Anyway, now that I've gotten that out of my system and am off from school I can get back to Torque :)

Recent Blog Posts
List:04/10/08 - Blender DTS Exporter 0.96 Released
09/11/07 - Blender Orange Guy Now available
08/10/07 - Blender DTS Exporter 0.95 Released
02/04/07 - Blender DTS Exporter 0.94 Released
12/26/06 - Blender DTS Exporter 0.93 Released
11/25/06 - Blender DTS Exporter version 0.92 released
02/15/06 - Blender Exporter User interface Overview, more to come.
05/21/05 - Plan for Joseph Greenawalt

Submit ResourceSubmit your own resources!

Matt Fairfax   (May 21, 2005 at 07:33 GMT)   Resource Rating: 5
Very cool!

Ben Garney   (May 21, 2005 at 08:20 GMT)
That's really awesome. Nice work! Scan someone's head. ;)

Timothy Aste   (May 21, 2005 at 08:27 GMT)
That's pretty freaking impressive! Talk about homebrew!

Joseph Greenawalt   (May 21, 2005 at 08:47 GMT)
Thanks guys :) Right now the thing's sitting on my dresser with a sheet thrown over it, where it's been for several months. I didn't want the temptation of working on it distracting me from my studies (out of sight, out of mind :) Can anyone recommend a good book or two on 3D math (or even Analytic Geometry in general)? I'd like to fix some of the kludges that I used to yet again duck out of really getting a good grasp on it ...

Nauris Krauze   (May 21, 2005 at 09:10 GMT)
You should hook up with TomB, homemade Amiga plus 3D laser scanner as input device would be the weirdest thing ever concieved.

Adrian Walters   (May 21, 2005 at 10:02 GMT)
sounds great, but the website appears to be 'disabled'

Tom Bampton   (May 21, 2005 at 13:44 GMT)
Hahaha, thats great. Im getting ideas now ... damn ;-)

Nicolas Quijano   (May 21, 2005 at 15:49 GMT)
Nice :)

Joseph Greenawalt   (May 21, 2005 at 17:48 GMT)
@Adrian:

It seems to be working from here, did you get an error message?

@All:

Thanks for the encouragement, everyone!

Phil Carlisle   (May 21, 2005 at 20:04 GMT)
Nice little toy Joseph, its a pity that the output is almost entirely useless :) we have an example of this kind of equipment in our design lab and myself and some students had a play with it (he was scanning his daughter/son's barbie and action man dolls for a project). turns out that the whole point cloud it produces is a bit... well... useless for game purposes.

Ah well, cool project! and cheap too!

This might make a good panorama capture head, if you stick the camera at the centroid of the turntable :)

Joseph Greenawalt   (May 22, 2005 at 02:00 GMT)
Thanks Phil. Yeah, it is admittedly not very useful :) I thought about rotating the laser rather than the object, but I wouldn't be getting much angular resolution at a distance of anything more than about 2 feet (might be good enough for a face capture). It should be possible to "connect the dots" so to speak and end up with a polygon model, but smoothing it out and making it look decent is beyond my abilities. Oh well, I had fun and got further than I though I would. I hadn't though of trying to do panoramic photography with it, interesting idea. I've kinda become interested in close range photogrammetry (3d reconstruction of objects/buildings from two or more photographs taken at differing angles) now, but I'm getting way ahead of myself until I sit down and study some more math :)

You must be a member and be logged in to either append comments or rate this resource.