POV-Ray : Newsgroups : povray.general : projective transformations Server Time
4 Nov 2024 13:34:37 EST (-0500)
  projective transformations (Message 1 to 4 of 4)  
From: mimmo
Subject: projective transformations
Date: 25 Jul 2007 11:20:02
Message: <web.46a7697cabf1811949aa3f520@news.povray.org>
Is it possible to use projective transformations in povray?
I'd need to adapt a checker to an irregular four-sided, planar figure and
this cannot be done using only affine transformations such as rotations,
scaling transformations, translations and their compositions.

Thank you,
mimmo


Post a reply to this message

From: Chris B
Subject: Re: projective transformations
Date: 25 Jul 2007 15:37:23
Message: <46a7a673@news.povray.org>
"mimmo" <dom### [at] unitnit> wrote in message 
news:web.46a7697cabf1811949aa3f520@news.povray.org...
> Is it possible to use projective transformations in povray?
> I'd need to adapt a checker to an irregular four-sided, planar figure and
> this cannot be done using only affine transformations such as rotations,
> scaling transformations, translations and their compositions.
>
> Thank you,
> mimmo
>

Hi Mimmo,

I believe you should be able to do this by defining a function to use as a 
pigment (though I've not tried it and don't know the maths you'd need). If 
my understanding of this is correct, you should be able to use the checker 
pattern in the function and apply a suitable mathematical 
deformation/transformation to it. See "Function as pattern" in the help 
(Section 3.5.11.15 in the Windows version.), which actually uses the checker 
pattern option in one of the examples.

A somewhat less sophisticated approach is simply to project light (a point 
source) through a patterned surface. The following example illustrates this 
excessively crude technique. This technique is obviously limited in what it 
can achieve and I wouldn't recommend using it if you need anything much less 
trivial than this example. Nevertheless, I thought I'd throw it in as you 
may just find it meets your needs and it's probably an order of magnitude 
easier to visualise.

camera {location <-0.3, 0.8,-2> look_at  <0,0,0>}
light_source { <-20, 20, -20> color rgb <1,1,1>}

box {0,1 pigment {color rgb 1}}
box {0,-1 pigment {color rgb 1} translate z*0.5}
plane{-y,0
  pigment{checker
    color rgbf <4,1,0,0.4>
    color rgbf <1,1,1,1>
    scale 0.1
  }
  rotate -20*x translate 4*y
  no_image
}

Regards,
Chris B.


Post a reply to this message

From: Chris B
Subject: Re: projective transformations
Date: 25 Jul 2007 16:15:51
Message: <46a7af77$1@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote in message 
news:46a7a673@news.povray.org...
>
> "mimmo" <dom### [at] unitnit> wrote in message 
> news:web.46a7697cabf1811949aa3f520@news.povray.org...
>> Is it possible to use projective transformations in povray?
>> I'd need to adapt a checker to an irregular four-sided, planar figure and
>> this cannot be done using only affine transformations such as rotations,
>> scaling transformations, translations and their compositions.
>>
>> Thank you,
>> mimmo
>>
>
> Hi Mimmo,
>
> I believe you should be able to do this by defining a function to use as a 
> pigment (though I've not tried it and don't know the maths you'd need). 
> ... snip ...

Here's what I arrived at through messing about for a couple of minutes with 
that trying to get a perspective-like pattern:

camera {location <0, 0,-20> look_at  0}
light_source { <-20, 20, -20> color rgb <1,1,1>}

#include "functions.inc"
#declare FOO = function {pigment { checker scale 10} }

plane {-z,0
   pigment {
     function { FOO(x/y*20,sqrt(y)*100,z).green}
   }
}

Regards,
Chris B.


Post a reply to this message

From: mimmo
Subject: Re: projective transformations
Date: 26 Jul 2007 03:35:00
Message: <web.46a84e19cb3fb5f749aa3f520@news.povray.org>
> > I believe you should be able to do this by defining a function to use as a
> > pigment (though I've not tried it and don't know the maths you'd need).
> > ... snip ...
>
> Here's what I arrived at through messing about for a couple of minutes with
> that trying to get a perspective-like pattern:
>
> camera {location <0, 0,-20> look_at  0}
> light_source { <-20, 20, -20> color rgb <1,1,1>}
>
> #include "functions.inc"
> #declare FOO = function {pigment { checker scale 10} }
>
> plane {-z,0
>    pigment {
>      function { FOO(x/y*20,sqrt(y)*100,z).green}
>    }
> }
>
> Regards,
> Chris B.

Thanks to all, it's just what I need to know.

mimmo


Post a reply to this message

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