POV-Ray : Newsgroups : povray.animations : bind the camera to a location of transformed objects Server Time
2 May 2024 17:32:15 EDT (-0400)
  bind the camera to a location of transformed objects (Message 1 to 3 of 3)  
From: DevMan
Subject: bind the camera to a location of transformed objects
Date: 19 Jan 2007 02:45:01
Message: <web.45b0762fe269e131bd8c5ded0@news.povray.org>
I am looking for a solution to get back the transformed location of an
object. I want to use that location as camera {location
MovedAnRotatedObjectLocation}.
I hoped to include the camera directly into the object hirarcy like
object{object{object1, object2,camera} translate<...> rotate <...>}
but that does not work.
Can anyone give me a hint to save transformed vectors in a deep hiracy and
work with them on the top-level (WCS) ie. camera relations?
Thanks.


Post a reply to this message

From: Chris B
Subject: Re: bind the camera to a location of transformed objects
Date: 19 Jan 2007 04:25:53
Message: <45b08ea1@news.povray.org>
"DevMan" <pet### [at] klemm-softwarede> wrote in message 
news:web.45b0762fe269e131bd8c5ded0@news.povray.org...
>I am looking for a solution to get back the transformed location of an
> object. I want to use that location as camera {location
> MovedAnRotatedObjectLocation}.
> I hoped to include the camera directly into the object hirarcy like
> object{object{object1, object2,camera} translate<...> rotate <...>}
> but that does not work.
> Can anyone give me a hint to save transformed vectors in a deep hiracy and
> work with them on the top-level (WCS) ie. camera relations?
> Thanks.
>

Hi,

I suspect that the 'transform' directive will end up being the key to 
achieving what you need.
You can assign an identifier to a transformation and re-use it as many times 
as you like.

#declare MyTransform = transform {translate <-1,0,0> rotate <20,90,10>}
sphere {0,1 transform MyTransform pigment {color rgb 1}}
box {... transform MyTransform ...}
camera {... transform MyTransform ...}

You can build up complex transformations by applying additional 
transformations on top of the first:

#declare MyTransform = transform {translate <-1,0,0>}
#declare MyTransform = transform {MyTransform rotate <20,90,10>}

and you can obtain the inverse of a given transformation using the 'inverse' 
keyword:

#declare InverseTransform = transform {MyTransform inverse}

Regards,
Chris B.


Post a reply to this message

From: DevMan
Subject: Re: bind the camera to a location of transformed objects
Date: 22 Jan 2007 02:30:01
Message: <web.45b46786d0b80ee6bd8c5ded0@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> "DevMan" <pet### [at] klemm-softwarede> wrote in message
> news:web.45b0762fe269e131bd8c5ded0@news.povray.org...
> >I am looking for a solution to get back the transformed location of an
> > object. I want to use that location as camera {location
> > MovedAnRotatedObjectLocation}.
> > I hoped to include the camera directly into the object hirarcy like
> > object{object{object1, object2,camera} translate<...> rotate <...>}
> > but that does not work.
> > Can anyone give me a hint to save transformed vectors in a deep hiracy and
> > work with them on the top-level (WCS) ie. camera relations?
> > Thanks.
> >
>
> Hi,
>
> I suspect that the 'transform' directive will end up being the key to
> achieving what you need.
> You can assign an identifier to a transformation and re-use it as many times
> as you like.
>
> #declare MyTransform = transform {translate <-1,0,0> rotate <20,90,10>}
> sphere {0,1 transform MyTransform pigment {color rgb 1}}
> box {... transform MyTransform ...}
> camera {... transform MyTransform ...}
>
> You can build up complex transformations by applying additional
> transformations on top of the first:
>
> #declare MyTransform = transform {translate <-1,0,0>}
> #declare MyTransform = transform {MyTransform rotate <20,90,10>}
>
> and you can obtain the inverse of a given transformation using the 'inverse'
> keyword:
>
> #declare InverseTransform = transform {MyTransform inverse}
>
> Regards,
> Chris B.

Hello Chris,
thank you. It works pretty good!
Best regards,
Peter


Post a reply to this message

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