How to build a 3D scanner with a webcam and a hand-held laser

The most accurate results are gained by using a true black and white camera. When you're satisfied with the settings, click the 'Start' button in the DAVID scanner and slowly pan the laser line over your subject.

The software needs to be able to locate a definite 'V' on the enclosure, so you will need to keep the laser up quite high. It may be tempting, but it's counter-productive, to keep scanning the laser up and down multiple times, as this will generate a lot of noise.

Do one scan from one side of the subject, and then do another from the other side. This goes a long way towards filling unwanted holes in the scan. Try to move the laser as slowly and steadily as possible. You'll get much better results if you are able to attach the laser to a tripod with a pivot mechanism.

If you want to apply a texture to the scanned model, you will need to turn the lights back on and then reset the camera's settings. All you have to do then is click the 'Grab Texture' button and the texture will be automatically applied. Be very careful to use the same lighting conditions and camera settings each time you grab the texture or your finished model will be a patchwork of different colours. Try to light the subject evenly, and avoid shadows wherever possible.

To finish up, you can smooth your model with judicious use of the 'Interpolation' and 'Filtering' buttons. The instinct is to go overboard with the filters, but try not to overdo it or you'll lose most of the fine data. Check that you're satisfied with the produced 3D model and save it.

You'll need to rotate the model and repeat the scanning procedure several times to grab the full subject. Try to have a bit of overlap between each scan, as this will make stitching a lot easier.

Stitching the model

Saving stitched models isn't possible in the free version of DAVID, but you can download MeshLab if you want to go any further for free.

Open MeshLab, then open the first scan and next open the subsequent scans inside the first one. To start stitching, click the big 'A' on the toolbar, select the first entry in the list and click 'Glue Mesh Here'. Now you need to start gluing the other meshes to the first one. Select the second entry and then click on 'Point- Based Gluing'.

A new window will open, showing the two objects you selected for stitching. You need to select four points on the first scan that correspond to points on the second scan. Try and spread the points out as much as you possibly can to give the application a lot of 3D data to work with. If you don't, then MeshLab will do a poor job of meshing the two scans together.

If it's wrong, just unglue the second scan and try again. When you're finished, quit the Stitching tool and either flatten the layers and save as an OBJ file or keep the layers and save as an AIN file.

You can now take your finished 3D scan and import it into almost any 3D-modelling application, from Google Sketchup to Maya. The object will appear in these programs just as you made it, and to the correct scale.

-------------------------------------------------------------------------------------------------------

First published in PC Plus, Issue 278

Now read How plastics promise a computing revolution

Sign up for the free weekly TechRadar newsletter
Get tech news delivered straight to your inbox. Register for the free TechRadar newsletter and stay on top of the week's biggest stories and product releases. Sign up at http://www.techradar.com/register

Follow TechRadar on Twitter