TexMapPreview at work on woddy Download TexMapPreview

TexMapPreview

This is a simple program that renders a deformation of an image.

TexMapPreviewConvert

This is a simple bash script wrapper for TexMapPreview which, using ImageMagick's convert tool, allows input textures and output images to be any image file format that convert can read/write respectively.

All files copyright Alec Jacobson unless otherwise noted

TexMapPreview

Dependencies:

  1. GLUT (and OpenGL)

Compile with:


    make

Run with:


    ./TexMapPreview mesh.obj texture.tga output.tga

Or to just display a deformed texture:


    ./TexMapPreview mesh.obj texture.tga

Example #1


    ./TexMapPreview woody.obj woody.tga output.tga

This produces output.tga which shows how the woody.tga texture looks fit to the woody.obj mesh

Example #2


    ./TexMapPreview woody-deformed.obj woody.tga output.tga

This produces output.tga which shows how the woody.tga texture looks mapped onto woody-deformed.obj which contains texture coordinates.

Example #3


    ./TexMapPreview woody-deformed.obj woody.tga

Opens a GLUT window which shows how the woody.tga texture looks mapped onto woody-deformed.obj which contains texture coordinates.

Helpful notes

Use ImageMagick's convert tool to convert between formats like png to tga.

To convert a png with transparency to a tga with alpha channel:


    convert input.png output.tga

To convert a tga with alpha channel to a png with transparency:


    convert input.tga output.png

TexMapPreviewConvert.sh

Dependencies:

  1. TexMapPreview
    • GLUT (and OpenGL)
  2. convert (from the ImageMagick suite)
  3. Bash

Run with:


    ./TexMapPreviewConvert.sh mesh.obj texture.inext output.outext
where inext and outext are image file format extensions which convert recognizes

Example #1


    ./TexMapPreviewConvert.sh woody-deformed.obj woody.png

Display deformed woody mesh using .png file as texture

Example #2


    ./TexMapPreviewConvert.sh woody-deformed.obj woody.png output.png

This produces output.png which shows woody deformed using a .png file as a texture