spacer
spacer

Juan Quiroz
quiroz[at]cse.unr.edu

spacer
 
header
 
 

Home IGAs Papers Code Movies Resume
Convert OBJ to BMP
CreateBMP.cpp
The script takes a .obj file and converts it into a .pgm file. ImageMagick is then called from the script to convert the .pgm file to .bmp.
The bitmap created is 369x369, since that's the only size supported by Lagoon according to Chris. The size can be changed on the source code.
If you don't have ImageMagick installed, then running the script with the -c flag will not do the conversion from .pgm to .bmp. The .pgm file can then be opened with a paint editor, such as The GIMP to convert it to bmp.

The file created is named the same as the obj file with a .pgm or .bmp appended to the end. So if your obj file is named boat.obj, then the script will create a both boat.obj.bmp and boat.obj.pgm, unless you don't want to convert the pgm to bmp, in which case only boat.obj.pgm will be created.

This code is given AS IS! Run it at your own risk.

Compiling the Script:
At the command line type:
g++ -o execName CreateBMP.cpp
Where execName is whatever you would like to name the script executable.
Ignore warnings, if any...

Running the Script:
At the command line type:
execName -f file.obj [OPTION]
Options:
  -f obj file name.
  -i Initialize the map to white. Points for which no information is found will be in white.
  -c Don't convert to PGM file to BMP.
  -h Print help.
  -s Normalize the image by setting the value of each point to the average of itself and all its neighbors.

 
   
spacer