POV-Ray : Newsgroups : povray.general : Camera angles problem : Re: Camera angles problem Server Time
29 Jul 2024 08:13:25 EDT (-0400)
  Re: Camera angles problem  
From: Anthony D  Baye
Date: 16 Aug 2013 15:40:00
Message: <web.520e7fba572d40e6328783aa0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 16.08.2013 20:08, schrieb Anthony D. Baye:
> > clipka <ano### [at] anonymousorg> wrote:
> >> Am 16.08.2013 06:27, schrieb Anthony D. Baye:
> >>> I should also be clear that with vrotate(A,B), B is also a vector.  So:
> >>>
> >>> object {
> >>>       ...
> >>>       translate vrotate(A, B)
> >>> }
> >>>
> >>> is the same as:
> >>>
> >>> object {
> >>>       ...
> >>>       translate A
> >>>       rotate B
> >>> }
> >>
> >> Nope. It's rather like
> >>
> >>       rotate <0,0,-B.z>
> >>       rotate <0,-B.y,0>
> >>       rotate <-B.x,0,0>
> >>       translate A
> >>       rotate B
> >
> > Then the documentation needs serious clarification.  That is not mentioned at
> > all.
> >
> > http://www.povray.org/documentation/view/3.7.0/229/
> >
> > From: Pov-Ray documentation 2.2.1.4 Vector Expressions --
> > "vrotate(A,B) Rotate A about origin by B. Given the x,y,z coordinates of a point
> > in space designated by the vector A, rotate that point about the origin by an
> > amount specified by the vector B. Rotate it about the x-axis by an angle
> > specified in degrees by the float value B.x. Similarly B.y and B.z specify the
> > amount to rotate in degrees about the y-axis and z-axis. The result is a vector
> > containing the new x,y,z coordinates of the point."
>
> What you're missing is that
>
>      object {
>        ...
>        translate vrotate(A,B)
>      }
>
> only translates the object by the offset computed as "vrotate(A,B)", while
>
>      object {
>        ...
>        translate A
>        rotate B
>      }
>
> /obviously/ not only translates the object, but also rotates it. If the
> object in question is a sphere originally created at <0,0,0> this
> doesn't matter, but if it is, say, a cube, then this changes the
> orientation of its edges in space.
>
> To compensate for this, you'd have to apply the inverse rotation to the
> object first, /then/ translate by A, and finally apply the rotation by
> B. This will indeed effectively apply a rotation to the A vector used
> for translation, while leaving the object's orientation in space
> effectively unchanged.
>
> I think there's no need for additional clarification in the docs, as
> this should be obvious enough once you think a few moments about the
> features involved (translate, rotate, and vrotate). The docs can't
> account for /all/ exotic combinations of features.

I wasn't considering the object's orientation, only it's position w/r/t to the
origin, so I guess I was at least partially wrong.

Still, the transformation is not at all as obvious as you say it is: Not
everyone is a wiz at visualizing complex 3D transformations.

Reminds me of math teachers talking to the chalkboard and saying "The obvious
conclusion is..." when it's obvious to them, but they aren't the student.

So, yes, when you experiment with it, it becomes obvious that there is a
pre-translation rotation happening to prevent the object's orientation from
being changed.

Regards,
A.D.B.


Post a reply to this message

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