|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
My favorite macro is Reorient, but I'm always annoyed at how it will rotate
an object along its axis as it reorients it. What is more annoying is a
fix:
given a camlook_at variable and the camloke variable, I was reorienting a
camera and found the annoying rotation:
//#declare cameratransform=transform{ Reorient (z,camlook_at-camloke)
translate camloke}
However, this gives the response I'm looking for, even if it is
mathematically close.
#declare cameratransform=transform{ Reorient (z,seedirn*<1,0,1>) Reorient
(seedirn*<1,0,1>,seedirn)translate camloke}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Greg M. Johnson wrote:
>My favorite macro is Reorient, but I'm always annoyed at how it will rotate
>an object along its axis as it reorients it.
Greg, if you want to force the rotation of the camera to
happen in the xy-plane only (i.e. around the y-axis), you
could do it like this:
// Untested code below
#version 3.5;
#include "transforms.inc"
....
#declare pNextCameraLocation = ...
#declare pNextCameraLookAtLocation = ...
....
#declare vCurrentLookDirection = z;
#declare vNextLookDirection = pNextCameraLookAtLocation -
pNextCameraLocation;
#declare vRotateFrom = vCurrentLookDirection*(x + z);
#declare vRotateTo = vNextLookDirection*(x + z);
#declare CameraTransform =
transform {
Reorient_Trans(vRotateFrom, vRotateTo)
translate pNextCameraLocation
}
Some further comments:
To find the axis that the reorientation will be done around,
you can take the cross product of the vector that points in
the object's current direction and the vector that points in
the direction that you want the object to point in.
This means that the Axis_Rotate_Trans() macro can be used
to reoerient objects in the same way as the Reorient_Trans()
macro can.
In some cases it may be useful to have the reorientation of
an object to happen in several small steps (e.g. along with
the clock for animations). This can be achieved with the
Axis_Rotate_Trans() macro.
(I can show some example code if anyone is interested.)
>What is more annoying is a fix:
>given a camlook_at variable and the camloke variable, I was reorienting a
>camera and found the annoying rotation:
>
>//#declare cameratransform=transform{ Reorient (z,camlook_at-camloke)
>translate camloke}
>
>However, this gives the response I'm looking for, even if it is
>mathematically close.
>
>#declare cameratransform=transform{ Reorient (z,seedirn*<1,0,1>) Reorient
>(seedirn*<1,0,1>,seedirn)translate camloke}
Btw.:
I just noticed that John has provided an alternative solution
to this problem in your "Derailed IRTC entry" thread:
http://news.povray.org/povray.off-topic/29424/
Tor Olav
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks for your consideration, but I'm wondering if you understand the
phenomenon I'm complaining about. Please see my latest posting at p.b.a.
>
> Greg, if you want to force the rotation of the camera to
> happen in the xy-plane only (i.e. around the y-axis), you
> could do it like this:
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|