en it

The Mesh primitive and UV mapping

The Mesh primitive can have UV mapping coordinates, if created from an OBJ file that includes them.

These coordinates can be used to map HDR pictures or even procedural textures on surfaces without the overhead of specifying all the awkward transformations that would be necessary using a .cal file (like picture.cal)

The steps required to use UV mapping with a Radiance Mesh are the following:

  1. Create an UV mapped model, with Blender for example or any other 3D authoring tool that is capable of doing so.
  2. Convert it to OBJ format: obj2mesh -a materials model.obj > model.rtm
  3. Convert the Radiance HDR format: ra_tiff -r image.tif image.pic
  4. Get the aspect ratio of the picture: getinfo -d image.pic | rcalc -e ‘$1=$5/$3’
  5. Create the Radiance scene description:
 void colorpict image
 7 red green blue image.pic  .  A1*((Lu-A3)/A5-floor((Lu-A3)/A5))  A2*((Lv-A4)/A6-floor((Lv-A4)/A6))
 0
 6 Ru Rv Tu Tv Su Sv
 #6 A1 A2 A3 A4 A5 A6
 image plastic material
 0
 0
 5 1 1 1 0 0
 void mesh id
 1 model.rtm
 0
 0

where:

  • Su, Sv are defining the scale (1 = 100%, 0.5 = 50% and so on)
  • Tu, Tv are defining the translation/clipping (1 = 100%, 0.5 = 50% and so on)
  • Ru,Rv are defining the picture aspect ratio (1,R or R,1)

FIXME

the_mesh_primitive_and_uv_mapping.txt · Last modified: 2007/08/23 22:28 by pisuke
Recent changes · Show pagesource · Login