|
![](/i/fill.gif) |
Am 16.08.2013 20:08, schrieb Anthony D. Baye:
> clipka <ano### [at] anonymous org> 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.
Post a reply to this message
|
![](/i/fill.gif) |