******************************************************************************************

			Blob Man v2.0 for POV-Ray v3.1x		    

                            by Peter Houston 1999

******************************************************************************************
     The latest version of the package is avilable from my website (see section 8.0)
******************************************************************************************

0.0  INTRODUCTION
1.0  INSTALLATION
2.0  QUICK START
3.0  BASIC FEATURES
  3.1  Blob_Man Macro
  3.2  Textures
  3.3  Origin Variables
4.0  ADVANCED FEATURES
  4.1  Head Macro
  4.2  Torso Macro
  4.3  Hand Macro
  4.4  Feet Macro
  4.5  Hair Macro
5.0  HINTS & TIPS
6.0  MISC INFO
  6.1  Creating Face Image Maps
  6.2  Blob Man's Future
  6.3  Known Problems
7.0  HISTORY
8.0  CONTACTING THE AUTHOR
9.0  CREDITS

******************************************************************************************
1.0  INTRODUCTION
******************************************************************************************
Blob Man is a articulated humanoid figure standing approximately 65 units tall.
Blob man has the following user-defined features :-

Figure:  Build and skin texture.
Head  :  Full movement, independently closing eyelids, turning eyes, iris colour, 
         image maps for face, mouth size and lip texture, hair growth and hair texture.
Arms  :  Full movement of both upperarms and forearms
Hands :  Full movement, independently articulated fingers.
Legs  :  Full movement of both thighs and calves.
Feet  :  Full movement.

These macros evolved from the excellent work of Govert Zoethout, who created the original 
blob man without legs or hands.

******************************************************************************************
1.0  INSTALLATION
******************************************************************************************
Copy all *.INC, *.PNG and *.POS files to one of the directories (folders) in your POV-Ray 
library path (as for example, the default include directory). If you dont know what they 
are, open your POVRAY.INI. If you have a PC running Windows95/98 or WindowsNT, they 
probably look something like this: 

Library_Path=C:\POV-Ray for Windows\include

******************************************************************************************
2.0  QUICK START
******************************************************************************************
Create a basic scene file similar to this : 

//*************************************
global_settings {  assumed_gamma 2.2 }

camera {  
        location  <-40, 100, -150.0>
        direction 1.5*z
        right     4/3*x
        look_at   <0.0, 35,  0.0>
}

background {rgb 0}

light_source {
                <0,100,-100>
                color red 1.0  green 1.0  blue 1.0
}

plane {
        y, 0
        pigment { rgb <0,1,0> }
}
                             
/***********************************************************
The following code loads the Blob Man Include and Pose files
and creates the figure located at <0,0,0>
************************************************************/
 
#include "blob_man.inc"
#include "default.pos"

Blob_Man(0,0.5,1,<.75,1,1>,0,0,0,<.5,.5,.5>,0,0)

object {BlobMan translate Origin_RL+<0,1.3,0>}

// EOF

******************************************************************************************
3.0  BASIC FEATURES
******************************************************************************************

3.1  Blob_Man Macro
===================
Before the Blob_Man Macro can be called the "blob_man.inc" file needs to be included, also 
certain arrays need to be created for the pose positions, there is a sample pose library 
supplied with the Blob_Man package called "default.pos", which can be included also.  
The "blob_man_studio.pov" scene file creates a "bmstudio.pos" file when it is run, this 
contains the array data as it appears in the "default.pos" file, simply rename this file
to create your own pose library.

The syntax for calling the macro is as follows :-

Blob_Man( PoseNo , Build , Face_Map , Eye_Colour , Right_Lid , Left_Lid , HairStyle , 
          Hair_Col , Left_Hand , Right_Hand )
          
PoseNo    : [ FLOAT ] Array position for the pose (see "default.pos")
Build     : [ FLOAT ] Blob Threshold Level. Range : 0.31(Fat) to 1(Thin)
Face_Map  : [ FLOAT ] Image Map Number 0=No Image Map (see section 3.2)
Eye_Colour: [<R,G,B>] Colour of Iris.
Right_Lid : [ FLOAT ] Position of Right Eye Lid Range : 0=Open to 1=Closed 
Left_Lid  : [ FLOAT ] Position of Left Eye Lid Range : 0=Open to 1=Closed 
HairStyle : [ FLOAT ] Array position for the Hair Style (see "default.pos"} 
Hair_Col  : [<R,G,B>] Basic colour of hair if no Texture is declared ( see section 3.2} 
Right_Hand: [ FLOAT ] Array position for the Hand Type (see "default.pos"} 
Left_Hand : [ FLOAT ] Array position for the Hand Type (see "default.pos"} 

Once called an object BlobMan is declared, this can now be positioned as required.

3.2  Textures
=============
In its basic form Blob_Man declares two default textures, but these can be user defined,
along with an optional texture.

Skin_Tex : This is the overall texture for the figure, if it is undeclared the default 
           texture will be used.

           Default: Skin_Tex= texture {pigment{rgb <.9,.7,.6>}
                                finish{phong .3 phong_size 40}
                                normal{crackle .2 turbulence .7 scale .7}
                              }

Lip_Tex  : This is the texture for the figures lips, if it is undeclared the default 
           texture will be used.
                                      
           Default: Lip_Tex = texture {pigment{rgb <.7,.3,.2>}
                                finish{phong .3 phong_size 40}
                                normal{crackle .2 turbulence .7 scale .7}
                              }                                      

Hair_Tex : This is the texture for the figures hair, if it is undecalred then the Hair_Col
           <r,g,b> variable passed by the Blob_Man macro will be used to generate a 
           randomised hair colour.  There is no default hair texture.

In addition to these textures, there is also a defineable Image Map that is used for the 
face, this is called via the Blob_Man Macro and is represented by a number (see section 3.1).
The image maps are named bmface#.png with the # being the number in the macro.
There are currently only 5 image maps supplied with this package, however more will be 
more available on my web page (see section 8.0)
For tips on creating your own image maps refer to section 6.1

3.3  Origin Variables
=====================
The Blob_Man Macro declares the following Origin variables for you to locate the figure and
other objects in relation to the figure.

Origin_RA : Vector position of Right Wrist
Origin_RL : Vector position of Right Ankle

Origin_LA : Vector position of Left Wrist
Origin_LL : Vector position of Left Ankle

Simply translate the BlobMan object by one of these vectors to move that point to <0,0,0>.

******************************************************************************************
4.0  ADVANCED FEATURES
******************************************************************************************
Each of the macros that make up Blob Man can each be called individually if required.  This
could be useful if you do not want to use arrays, or if you wanted to replace or individually
scale various body parts.

Call all of these macros from within an object{} definition.  Skin_Tex and Lip_Tex need to be 
decalred before the macros arec alled or the default textures will be used (see section 3.2)

4.1  Head Macro
===============          
The syntax for using this macro is as follows :

head( Build , Eye_Colour , Right_Lid, Left_Lid , Eye_Rot , Lip , 
       Twist , Tip , Tilt, Face_Map )

Build     = [ FLOAT ] Blob Threshold Level (range 0.31(Fat) to 1(Thin))        - Standard: .5
Eye_Colour= [<R,G,B>] Iris Colour of eye 
Right_Lid = [ FLOAT ] Right Eye Lid Position  (Range : 0-Open to 1-Closed)     - Standard: 0
Left_Lid  = [ FLOAT ] Left Eye Lid Position  (Range : 0-Open to 1-Closed)      - Standard: 0
Eye_Rot   = [ FLOAT ] Eye Rotation Angle ((-)Left to (+)Right)                 - Standard: 0
Lip       = [ FLOAT ] Mouth Size (Range: -0.5(Small) to 0.5(Large))            - Standard: 0
Twist     = [ FLOAT ] Head rotation Right to Left (Range: -85 to 85)           - Standard: 0
Tip       = [ FLOAT ] Head position Front to Back (Range: -15 to 50)           - Standard: 0
Tilt      = [ FLOAT ] Head position Right Side to Left Side  (Range: -25 to 25)- Standard: 0
Face_Map  = [ FLOAT ] Image Map used for face 0=No Map (see section 3.2)


4.2  Torso Macro
================
The syntax for using this macro is as follows :

torso(Build , RA_S2E , RA_E2W , LA_S2E , LA_E2W , 
              RL_H2K , RL_K2A , LL_H2K , LL_K2A  )

Build  = [ FLOAT ] Blob Threshold Level (range 0.31(Fat) to 1(Thin)) - Standard: .5
RA_S2E = [<X,Y,Z>] Right Arm Shoulder to Elbow rotation vector       - Standard: <0,0,0>
RA_E2W = [<X,Y,Z>] Right Arm Elbow to Wrist rotation vector          - Standard: <0,0,0>
LA_S2E = [<X,Y,Z>] Left Arm Shoulder to Elbow rotation vector        - Standard: <0,0,0>
LA_E2W = [<X,Y,Z>] Left Arm Elbow to Wrist rotation vector           - Standard: <0,0,0>
RL_H2K = [<X,Y,Z>] Right Leg Hip to Knee rotation vector             - Standard: <0,0,0>
RL_K2A = [<X,Y,Z>] Right Leg Knee to Ankle rotation vector           - Standard: <0,0,0>
LL_H2K = [<X,Y,Z>] Right Leg Hip to Knee rotation vector             - Standard: <0,0,0>
LL_K2A = [<X,Y,Z>] Right Leg Knee to Ankle rotation vector           - Standard: <0,0,0>


4.3  Hand Macro
===============
The syntax for using this macro is as follows : 
Call this macro twice, once for each hand.

hand( Build , H_S2E , H_E2W , H_Rot , Hand, 
       F_Spread, FP_Pos, FR_Pos, FM_Pos, FI_Pos, FT_Pos )

Build    = [ FLOAT ] Blob Threshold Level (range 0.31(Fat) to 1(Thin)) - Standard: .5
H_S2E    =*[<X,Y,Z>] Arm Shoulder to Elbow rotation vector - standard: As torso RA/LA_S2E
H_E2W    =*[<X,Y,Z>] Arm Elbow to Wrist rotation vector    - standard: As torso RA/LA_E2W
H_Rot    = [<X,Y,Z>] Hand rotation Vector                  - standard: <0,0,0>                                
Hand     = [ FLOAT ] Right Hand = -1 / Left Hand = 1
F_Spread = [ FLOAT ] Finger Spread        - 0 = Closed   , 1 = Relaxed , 2 = Wide
FP_Pos   = [ FLOAT ] Pinky Position       - 0 = Straight , 1 = Relaxed , 2 = Curled
FR_Pos   = [ FLOAT ] Ring Position        - 0 = Straight , 1 = Relaxed , 2 = Curled
FM_Pos   = [ FLOAT ] Middle Position      - 0 = Straight , 1 = Relaxed , 2 = Curled
FI_Pos   = [ FLOAT ] Index Position       - 0 = Straight , 1 = Relaxed , 2 = Curled
FT_Pos   = [ FLOAT ] Thumb Position       - 0 = Straight , 1 = Relaxed , 2 = Curled

* These MUST be the same as the Torso Macro if they are to line up correctly.  

4.4  Feet Macro
===============
The syntax for using this macro is as follows : 

feet( Build , RF_H2K , RF_K2A , LF_H2K , LF_K2A , RF_Rot , LF_Rot )

Build  = [ FLOAT ] Blob Threshold Level (range 0.31(Fat) to 1(Thin)) - Standard: .5
RF_H2K =*[<X,Y,Z>] Right Leg Hip to Knee rotation vector   - Standard: As torso RL_H2K
RF_K2A =*[<X,Y,Z>] Right Leg Knee to Ankle rotation vector - Standard: As torso LL_H2K
LF_H2K =*[<X,Y,Z>] Right Leg Hip to Knee rotation vector   - Standard: As torso RL_K2A
LF_K2A =*[<X,Y,Z>] Right Leg Knee to Ankle rotation vector - Standard: As torso LL_K2A
RF_Rot = [<X,Y,Z>] Right Foot rotation Vector              - Standard: <0,0,0>
LF_Rot = [<X,Y,Z>] Left Foot rotation Vector               - Standard: <0,0,0>

* These MUST be the same as the Torso Macro if they are to line up correctly.  

4.5  Hair Macro
===============
The syntax for using this macro is as follows : 

hair( Hair_On, Hair_Rot, Hair_Col, Hair_Arch, Hair_Thck, Hair_Line, Hair_LDpth, 
      Hair_Wght, Hair_Hght, Hair_Length, Hair_Curl, Twist, Tip, Tilt )

Hair_On     = [ FLOAT ] Hair (1) or No Hair (0)
Hair_Rot    = [<X,Y,Z>] Rotation Vector for Hair                      - Standard: <0,0,0>
Hair_Col    = [<R,G,B>] Hair Colour, Used if Hair texture is not decalred (see 3.2)             
Hair_Arch   = [ FLOAT ] Arch hairline over head inline with ears (1) or Not (0)
Hair_Thck   = [ FLOAT ] Thickness of Hair (Best settings 0.15 to 0.5) - Standard: 0.25
Hair_Line   = [ FLOAT ] Height of Hairline (Best settings 3 to 6)     - Standard: 5
Hair_LDpth  = [ FLOAT ] Hairline profile Depth (Range : 0 to 1)       - Standard: 0.7
Hair_Wght   = [ FLOAT ] Hair Weight (Range: 0.005 to 0.05)            - Standard: 0.01
Hair_Hght   = [ FLOAT ] Hair Height (Range: 1 to 2)                   - Standard: 1
Hair_Length = [ FLOAT ] Hair Length (Range: 1 to 20)                  - Standard: 10
Hair_Curl   = [ FLOAT ] Curliness (Range 0-Straight to 0.1-Curly)     - Standard: 0.05
Twist       =*[ FLOAT ] Head Twist Angle                              - Standard: As head
Tip         =*[ FLOAT ] Head Tip Angle                                - Standard: As head  
Tilt        =*[ FLOAT ] Head Tilt Angle                               - Standard: As head  

* These MUST be the same as the Head Macro if it is to line up correctly.  
     
******************************************************************************************
5.0  HINTS & TIPS
******************************************************************************************
To help in the positioning of Blob_Man, there is a DeBug variable that can be set, this 
generates visible locators to the ends of Blob Mans limbs.

When testing scenes avoid using hair, as the parse time increases considerably, if you
declare a variable eg HairTest=0, then multiply Hair setting by this number you only need 
to set HairTest=1 to turn the hair back on for all figures.

eg. 
  If using the Blob_Man Macro
     Blob_Man((0 , 0.5 , 1 , <.75,1,1> , 0 , 0 , 3*HairTest , <.5,.5,.5> , 0 , 0 )

  If using the hair Macro
     hair( 1*HairTest, <0,0,0>, <1,0,1>, 0, 0.25, 5, 0.7, 0.01, 1, 10, 0.05, 0, 0, 0 )

Use "blob_man_studio.pov" to create new poses, at [320 x 240, No AA] you can easily see if 
the limbs are positioned correctly, and it only takes about 80 seconds to render 
(without hair); thats on a P133 w/128Mb Ram.
Then when your happy with the pose, rename the "bmstudio.pos" file to create your own single 
Pose file, you can either do this for each figure required and simply include each pose 
before you run the Blob_Man Macro (So that the Arrays are re-defined each time), or you can 
copy all the poses into one Pose Library file and include it once, this was how "default.pos" 
was created. 
For further information about arrays, refer to the POV-Ray Documentation.

******************************************************************************************
6.0  MISC INFO
******************************************************************************************

6.1  Creating Face Image Maps
=============================
The image maps used for Blob Mans face are PNG format which uses the Alpha Channel.  
Use a Image Editor that allows you to edit the Alpha channel (eg. Paint Shop Pro, PhotoShop)
then create the areas that you wish to be mapped, in the alpha channel.  In the main image 
roughly colour the same areas the colours you want, it doesn't matter how accurate you are
as the aplha channel will make unwanted areas transparant.  Save in PNG Format with the 
file name "bmface#.png" where # is a unique number.
Look at "template.png" for reference points on the face, if you rename this file 
"bmface99.png" then use this as the Face_Map you will see where these reference points appear
on the model.

6.2  Blob Man's Future
=====================
Here are just a few ideas I have for improving Blob Man.

   * Bending and Twisting of the torso.
   * Clothing, and Jewelry.
   * Torso, Hand and Foot Image Maps; for Tattoos, War Paint, Chest Hair, Cybdernetics,
      Skin-Tight Superhero Suits, etc.
   * Windows UI to effectively mimic "blob_man_studio.pov"
      This is something I would need help with, any offers :)
   * Blob Lady and Blob Kids.                            
   
6.3  Known Problems
===================

Blob Man doesn't stand on y0 when you translate him using the Origin_LL or Origin_RL 
variables, this is because the Origins are actually the the end of the leg, not the bottom
of the feet.  Until I can figure out the lowest point of the feet when they are rotated
you need to translate the figure by y*1 when the feet rotated <0,0,0>, when the feet are 
at other rotions, I'm afraid its trial and error, but using the DeBug variable helps
(see section 5.0).

If the Arms are rotated above the shoulders (>90 degrees) then the Origin_LA and Origin_RA
variables do not locate properly, and you have to translate by an extra y*11 (the upperarm
length).

Because of the nature of blobs, and the way in which Blob Man is modelled, when the elbow,
wrists, ankles or knees get too close to other parts of the torso, the torso will be "cut 
out", this is due to the negative strength blobs used to sculpt the limbs.  This problem 
will be looked at before the next version of Blob Man.
   
******************************************************************************************
7.0  HISTORY
******************************************************************************************
v2.0    23 Apr 1999     Remodeled the head, and added variable image_map textures for the 
                        face, eye lid variables in head macro now have a range of 0-1 and 
                        are can be set for each eye, so winking is possible.
                        Remodeled the feet.
                        Added mass to the arms and legs.
                        Remodeled the hands and articulated the fingers, hand macro now 
                        needs to be called twice, once for each hand.
                        Externally defined skin texture.
                        Added a Blob_Man Macro to create a complete figure from a given 
                        pose number as defined in a Pose File (see "default.pos")
                        Rewrote the motion mechanics to make the code more readable.
                        Generally cleaned up the code.
                        Generated more Pre-Defined poses (see "default.pos")

v1.0    09 Apr 1999     Initial release.

v0.0    March  1999     Govert Zoethout published his source files.
                        Original Macros had static arms and no hands or legs, and was in 
                        his native language (which I can't speak)

******************************************************************************************
8.0  CONTACTING THE AUTHOR
******************************************************************************************
If you wish to contact me with bug reports, bug fixes, criticisms, comments, suggested 
improvements, questions, etc. you can reach me by email at:

   e-mail  : houston.graphics@iname.com

   Homepage: http://members.xoom.com/HoustonGraph/

******************************************************************************************
9.0  CREDITS
******************************************************************************************
Thanks go to the following :-

POV-Ray Team for producing such fantastic software, and FREE too !!!!

Govert Zoethout who without his original model, this work would never have come about.

Chris Colefax for the template of this readme file, producing excellent include files,
and inspiring me to contribute to the POV-Ray community.

All the helpful POV-Ray users around the world, who frequent the POV-Ray Newsgroups.
( news.povray.org )
  
******************************************************************************************
POV-Ray(tm) and Persistence of Vision(tm) are registered trademarks of the POV-Ray Team(tm)