POV-Ray : Newsgroups : povray.general : Help needed to calculate points on a plane for eval_pigment() Server Time
27 Dec 2024 14:51:06 EST (-0500)
  Help needed to calculate points on a plane for eval_pigment() (Message 1 to 2 of 2)  
From: Nekar Xenos
Subject: Help needed to calculate points on a plane for eval_pigment()
Date: 4 May 2013 18:52:38
Message: <op.wwk0hwq1ufxv4h@xena>
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

From: Nekar Xenos
Subject: Re: Help needed to calculate points on a plane for eval_pigment()
Date: 5 May 2013 11:53:03
Message: <op.wwmbqol4ufxv4h@xena>
Ignore that. That was fatigue speaking.
-- 
-Nekar Xenos-


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.