|
|
"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
|
|