Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
 Contact HP

HP.com home

Making PTMs with a .lp File

» 

HP Labs

» Research
» News and events
» Technical reports
» About HP Labs
» Careers @ HP Labs
» People
» Worldwide sites
» Downloads
Content starts here

PTMs are a simple representation and file format that allow lighting direction and material properties to be controlled interactively. This is especially useful for seeing subtle shape detail on the surface of objects.  PTMs are produced from a set of images taken with varying lighting direction.  

PTMs are usually produced with the PTM fitter program which is downloadable from http://www.hpl.hp.com/research/ptm/downloads/agreement.html . To use the PTMfitter, one first needs to construct a .lp file. This is easily done with a text editor such as Wordpad. The .lp file just tells the fitter where the files are located on your computer and what the lighting direction is for each image. Here is a sample .lp file: 

50

C:\Leaves512\91-001.jpg       -0.015760 0.196076 0.980462

C:\Leaves512\91-002.jpg       0.181637 0.075514 0.980462

C:\Leaves512\91-003.jpg       0.127865 -0.149482 0.980462

C:\Leaves512\91-004.jpg       -0.102547 -0.167864 0.980462

C:\Leaves512\91-005.jpg       -0.191321 0.045724 0.980462

C:\Leaves512\91-006.jpg       -0.269702 0.314284 0.910212

.

.

.

C:\Leaves512\91-049.jpg       -0.950980 -0.309253 -0.000204

C:\Leaves512\91-050.jpg       -0.587692 0.809084 -0.000204

The first line contains the number of images the fitter will read. For each image, the image filename is given (either .jpg, .tga or .ppm), then the x,y and z coordinates of a vector pointing at the light for that image. As one is looking at through the camera, the x axis is off to the right, the y axis is towards the top, and the z axis points at the camera from the center of the image. So, a light positioned where the camera is would have direction vector (0,0,1). Note that these vectors are normalized, which just means they have length 1. To normalize any vector (a,b,c) find its length = sqrt(a*a + b*b + c*c), and divide all three components by this length.

To run the fitter program double click on it. It will ask you several questions, here are suggested answers for ones that may be unclear: 

Enter desired fitting format: 1

Enter basis: 0 

That’s it, if everything went well you should have a PTM that you can use the PTMviewer to look at.

 
Printable version
Privacy statement Using this site means you accept its terms Feedback to HP Labs
© 2005 Hewlett-Packard Development Company, L.P.