|  |  | I want to convert my paint macro to paint a whole scene instead of just a  
single-colour object.
My idea is to first render the whole scene with ambient_light 1 to use  
obtain colours with eval_pigment().
The image is then mapped onto a plane that is placed in such a way that it  
would render exactly the same scene.
Up to this point everything works fine.
But when it comes to calculating the position for eval_pigment on the  
plane, my math is not working out.
Here is a sample of the plane and the camera that match:
#declare CamColours=plane {z,CamDirect.z
                         texture {
                                 pigment {
                                       image_map { png "ArtistsMap.png"  
once }
                                       translate -0.5*(x+y)
                                       scale  
<image_width/image_height,1,1>*2
                                       }
                                 finish { ambient 1 diffuse 1}
                                 }
                            translate CamDirect
                            Reorient_Trans(z, (CamLook-CamPos))
                            translate CamPos
                            }
camera {
         location  CamPos
         direction CamDirect
         right   x*image_width/image_height
         look_at CamLook
         }
And here is my scan position that doesn't work.
ColPosX and ColPosY are x and y counters for scanning throught the x and y  
positions of the image:
#local ScanPos=( ((<-.5,-.5,0>+<ColPosX,ColPosY,0>)  
*<image_width/image_height,1,1>*2+CamDirect)*(CamLook-CamPos))+CamPos;
-- 
-Nekar Xenos-
Post a reply to this message
 |  |