July 22. 2000 - Hal Hawkins (Halbert)

Here is a new build of Steve Sloan II's pose2pov. I had found problems where pose2pov would create an ill-formed
.udo. This will work now. However there is still a bug; if you try to convert a .obj with multiple
meshes, pose2pov will generate the vertex_vectors only for the first mesh. I will work on that. For now,
export your .obj files as a single mesh.
Just run the utility on the .obj, fire up moray, load the .udo, and give it the apropriate image_map texture.

The original Pose2pov Readme file follows:


                              Pose2POV
                           Steve Sloan II
                          August  17, 1999

E-mail:            ssloan@HiWAAY.net
Home page:         http://go.to/startide

Download Pose2POV: http://home.HiWAAY.net/~ssloan/software

January 2000: Revisions, improvements, and Linux testing by
    Ekkehard Kraemer (ekraemer@pluto.camelot.de)

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

Table of Contents
-----------------
LAWYER BAIT......................Legal stuff
WHAT IT DOES.....................Description
COMMAND SUMMARY..................Program options
SAMPLE OUTPUT WITH UV MAPPING....Program's output explained
EDITING THE POV LIBRARY PATH.....Setting up POV
INSTALLING UV-POV................How to install the UV-mapping version
USING THE POV FILE...............How to render in POV
USING THE UDO FILE...............How to import into Moray modeler

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

LAWYER BAIT

This program was written by Steve Sloan, but with liberal borrowings
from Keith Rule's OBJ reader module from 3D GRAPHICS FILE FORMATS,
Copyright (c) 1995, 1996 Keith D. Rule, and a lot of help from
Ekkehard Kraemer. You may use this code in any way you like, as long
as you keep my name in the credits.

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

WHAT IT DOES

Converts Poser 4-exported Wavefront OBJ files to POV.

For POV-UV (and compatible patches), it can convert the Poser texture
maps, complete with UV mapping info, and for versions of POV without
the UV mapping patch, it can convert the diffuse/specular color info
into POV textures.

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

COMMAND SUMMARY

Command line:
pose2pov [-uv] [-ct] [path]filename[.obj] [path]filename2[.obj] ...

   -uv         Optional. Enables UV mapping -- for use with POV-UV and
               compatible patches

   -ct         Optional. It stands for "complete texturing" or maybe
               "complicated texturing." It tells pose2pov to include
               additional texture information, like specular and
               ambient color. Ordinary Poser people look weird in POV
               with those options enabled, so I suggest you only use
               this option if you want your character to be unusually
               shiny or metallic. If you want to recreate the Human
               Torch from the Fantastic Four, this setting might be a
               good idea...

   path        Optional. Without it, all files will be read from, and
               written to, the directory where you execute pose2pov.
               With it, the program will use the directory path.

   filename    The program will read an OBJ file named filename.obj and
               a material file called filename.mtl, and output a POV
               scene file called filename.pov, an include file of all
               the meshes called filename.inc, an include file with
               texture definitions named filenamet.inc, and a Moray UDO
               file called filenameu.udo. You can convert multiple OBJ
               files on the same command line, by listing them one
               after another.
                 
   .obj        You do not need the ".obj" file extension. The program
               will add it onto the end for you automatically.

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

SAMPLE OUTPUT WITH UV MAPPING

C:\Include>pose2pov -uv carmen

Exporting to UV-POV format...

Source Wavefront OBJ file:   carmen.obj
Source material file:        carmen.mtl
Target POV-Ray scene:        carmen.pov
Target Moray UDO:            carmenu.udo
Target POV-Ray mesh file:    carmen.inc
Target POV-Ray texture file: carment.inc

Reading  100% Complete
Make sure P4 woman texture2.png is in your POV path!
Make sure P4 woman bump.png is in your POV path!
Convert P4 woman texture2.tif to PNG format, then put it in your POV path!
Convert Female Hair 2 Texture.tif to PNG format, then put it in your POV path!

Stick a fork in me -- I'm done!

C:\Include>

When telling pose2pov what file to convert, you do not have to include
the ".OBJ" extension. The program adds that extension automatically.

Note the reminders about image map files. The files must be in POV's
library path for POV to be able to use them. The program assumes that
the user will take any image maps that come in file formats POV does
not support, and convert them to PNG format. You must convert the image
files to make your converted Poser object work in POV. I thought it
would be a good idea to remind you which files need converting.

Why PNG? PNG is supported by just about every version of POV-Ray, PNG
supports just about any color depth, and PNG has better compression
than TGA. I figure that makes it a safe and relatively compact
all-around universal image file format for POV.

How do you convert image files to PNG? There are several good freeware
and shareware programs that can do it, for just about any operating
system. My favorites in Windows 95/NT are IrfanView (freeware) and
Paint Shop Pro (shareware). For Unix/Linux, xv (shareware) and
ImageMagick (open source) can do it. I think the programs that come
free with QuickTime can handle the conversion for Macs.

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

SAMPLE OUTPUT WITHOUT UV MAPPING

C:\Include>pose2pov carmen

Exporting to POV-Ray 3 format...

Source Wavefront OBJ file:   carmen.obj
Source material file:        carmen.mtl
Target POV-Ray scene:        carmen.pov
Target Moray UDO:            carmenu.udo
Target POV-Ray mesh file:    carmen.inc
Target POV-Ray texture file: carment.inc

Reading  100% Complete
Stick a fork in me -- I'm done!

C:\Include>

Either version will list all the POV files you'll need to render the
converted Poser object. Make sure those files are in your POV library
path too.

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

EDITING THE POV LIBRARY PATH

Using your favorite text editor, go to your POV directory (usually
c:\Program Files\POV-Ray for Windows), then go to the renderer
subdirectory. Open a file named "povray.ini". Go down to the bottom of
the file. Copy the line "Library_Path=...", and paste it below the
original. Edit the path value in the new Library_Path line to point to
the directory where you want to keep your exported Poser objects. For
example, if you want to put your poser objects in a directory called
"C:\Poser", edit the new library path line to read,
"Library_Path=C:\Poser".

If you want more directories in your POV library path, simply repeat
the process. Copy the original "Library_Path" line, then edit the
directory it's set to. For example, I like POV-Ray to be able to get
to all of my computer's true-type fonts. You can add
"Library_Path=c:\Windows\Fonts" to do that. I also like to put all the
POV files I write myself in a seperate directory, called "c:\Include".
You can add the library path line "Library_Path=c:\Include" to let
POV-Ray get to those.

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

INSTALLING UV-POV

You need UV-POV (or some other version of POV with a UV-mapping patch)
to render texture maps on your Poser models. Here's how to get and
install it:

1. Get and install POV-Ray 3.1, if you don't already have it. You
   can find it in the downloads section of (http://www.povray.org).

2. Go get UV-POV from Nathan Kopp's POV patches page
   (http://nathan.kopp.com/patched.htm). UV-POV is in a file called
   uvpova5.zip. Use WinZip (or some other ZIP file utility) to extract
   the contents of uvpova5.zip into a temporary directory (like
   c:\uvpov). Use Windows Explorer to go to the temporary directory,
   find uvpov.exe, and move it to the "bin" subdirectory of your
   POV-Ray 3.1 directory (probably c:\POV-Ray for Windows v3.1\bin).
   Go back to the temporary directory, and move the rest of the stuff
   to your main POV directory (probably c:\POV-Ray for Windows v3.1).

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

USING THE POV FILE

1. Start up POV-Ray. If you translated your OBJ file with the "-uv"
   option, you must use UV-POV. Otherwise, you can run whatever
   version of POV you like.

2. Open the POV file you translated (carmen.pov in the Pose2POV
   run-throughs I showed you above.)

3. Adjust the render settings, hit the render button, and watch your
   Poser model appear.

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

USING THE UDO FILE

UDO files are used by Moray for Windows, a shareware modeler for POV.
Moray uses UDO files as wireframe placeholders for objects that are
defined in a POV include file. Moray users can manipulate UDO
wireframes the same way they would manipulate regular Moray objects.
When Moray uses POV to render a scene, the UDO calls the include file
it's standing in for, and the object in the include file is rendered
instead of the wireframe.

1. Start up Moray for Windows. If you don't already have it, you can
   go to http://www.stmuc.com/moray/ to download it. Please pay for it
   if you like it and you have the money! The Softronics guys do good
   work, and they should be supported.

2. Go to the Create tab. Click the UserDef button. Browse around until
   you find the UDO file you want, then double-click it. Moray will
   probably gripe "Directory not in search path." Go ahead and add the
   directory to the search path when it asks.

3. It will take Moray a moment or two to load the UDO file. When it
   does, a small yellow speck should appear at the center of each of
   the four view windows. In the TOP, FRONT, and SIDE windows, right-
   click your mouse, and select "Zoom to object." Your Poser figure
   should come into view. For the fourth window, you'll probably need
   to change your camera settings. Click the Select tab, then double-
   click the StdCam. Enter the coordinates of your new camera settings.
   A good camera setting to see a typical Poser figure is Location =
   (0, 0.5, 2), and Look_At = (0, 0.5, 0).

4. Moray will complain if you try to render your Poser figure without
   assigning it a texture. Click the Select tab, then double-click
   poser_object. Go down to the line labeled Material, and click the
   button on the right with the multicolored dot design. Click the
   Create button. Type in a name like PoserMaterial. Right-click the
   standard_texture line, and choose pigment. Right-click the pigment
   line, and select solid color. Click Assign, then click Close. The
   texture you added is just to keep Moray happy. When you render the
   Poser figure, Poser's textures will be used instead of the one you
   chose in Moray.

5. If you translated your Poser figure with the -uv option, you'll
   need UV-POV to render it. By default, Moray 3.1 sends its scenes
   to POV 3.1 to render. You'll need to change that. Go to
   Render|Render Options. Click the text area below "POV-Ray
   executable". Change "pvengine.exe" to "uvpov.exe". Click OK.

6. Make sure POV 3.1 isn't running! Things will be kinda ugly at
   rendertime if it is, believe me... ;-)

Now, you're ready to try it out! Hit the F9 button, and wait a while.
Moray will start up UV-POV if it's not already running. It will take
at least a good part of a minute for POV to read your model files, so
don't worry if it takes a while. After POV finishes reading the files,
Moray's camera window (lower right) will start showing the image as it
renders.

