POV-Ray : Newsgroups : povray.newusers : rotating the camera Server Time
29 Jul 2024 06:14:22 EDT (-0400)
  rotating the camera (Message 1 to 6 of 6)  
From: shimon a10
Subject: rotating the camera
Date: 2 Aug 2006 03:35:00
Message: <web.44d054c82ca3a9930777a030@news.povray.org>
Hi every body,

1. I want to know how to rotate the camera around the vector (which is the
   origin to the placement point of the camera).
2. I'm a new user so i need an example.
3. Lot's of thanks.

shimon


Post a reply to this message

From: Warp
Subject: Re: rotating the camera
Date: 2 Aug 2006 04:44:11
Message: <44d065db@news.povray.org>
shimon_a10 <shi### [at] wallacoil> wrote:
> 1. I want to know how to rotate the camera around the vector (which is the
>    origin to the placement point of the camera).

  I didn't completely understand what is it exactly that you want to
rotate the camera around, but here's a generic answer:

  If you want to rotate the camera around the origin (ie. the <0, 0, 0>
coordinate of space) then just add a 'rotate <something, something, something>'
to the end of your camera definition.

  If you want to rotate the camera around a given point, add these statements
at the end of your camera definition:

translate -ThePoint
rotate <whatever, whatever, whatever>
translate ThePoint

  Note that rotating the camera is the same as rotating an object. The
look_at coordinate will be rotated too, not just the location of the camera.

  If the point around which you want to rotate the camera is not the same
as the look_at coordinate and what you want is to only rotate the location
of the camera around a certain point while keeping look_at fixed, you need
to resort to some vector math. If you want to rotate the location of the
camera around the origin you can do it like this:

location vrotate(CameraOriginalLocation, <whatever, whatever, whatever>)

  If you want to rotate it around a certain point, it can be done like this:

location vrotate(CameraOriginalLocation-ThePoint,
                 <whatever, whatever, whatever>) + ThePoint

-- 
                                                          - Warp


Post a reply to this message

From: shimon a10
Subject: Re: rotating the camera
Date: 2 Aug 2006 07:50:00
Message: <web.44d0907a4df2b2d730777a030@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> shimon_a10 <shi### [at] wallacoil> wrote:
> > 1. I want to know how to rotate the camera around the vector (which is the
> >    origin to the placement point of the camera).
>
>   I didn't completely understand what is it exactly that you want to
> rotate the camera around, but here's a generic answer:
>
>   If you want to rotate the camera around the origin (ie. the <0, 0, 0>
> coordinate of space) then just add a 'rotate <something, something, something>'
> to the end of your camera definition.
>
>   If you want to rotate the camera around a given point, add these statements
> at the end of your camera definition:
>
> translate -ThePoint
> rotate <whatever, whatever, whatever>
> translate ThePoint
>
>   Note that rotating the camera is the same as rotating an object. The
> look_at coordinate will be rotated too, not just the location of the camera.
>
>   If the point around which you want to rotate the camera is not the same
> as the look_at coordinate and what you want is to only rotate the location
> of the camera around a certain point while keeping look_at fixed, you need
> to resort to some vector math. If you want to rotate the location of the
> camera around the origin you can do it like this:
>
> location vrotate(CameraOriginalLocation, <whatever, whatever, whatever>)
>
>   If you want to rotate it around a certain point, it can be done like this:
>
> location vrotate(CameraOriginalLocation-ThePoint,
>                  <whatever, whatever, whatever>) + ThePoint
>
> --
>                                                           - Warp

first thank u for your answer.

1. In my question i ment that: if i want to rotate the camera around certain
   veactor which act as an axis (for example: rotate the camera around the
   line which connect the origin to the camera point).
2. this vector which act as an optical axis is not paralel to the coordinate
   system.
3. again lots of thanks for your help.

shimon


Post a reply to this message

From: Warp
Subject: Re: rotating the camera
Date: 2 Aug 2006 08:57:46
Message: <44d0a14a@news.povray.org>
shimon_a10 <shi### [at] wallacoil> wrote:
> 1. In my question i ment that: if i want to rotate the camera around certain
>    veactor which act as an axis (for example: rotate the camera around the
>    line which connect the origin to the camera point).

  If you just want to rotate a point (eg. the location point of the camera)
around an arbitrary axis, you can use the vaxis_rotate() function for that:

http://povray.org/documentation/view/3.6.1/229/#s02_02_01_04_05

  If you want to rotate the entire camera as if it was an object, you
can use the Axis_Rotate_Trans() function in the transforms.inc include
file:

http://povray.org/documentation/view/3.6.1/488/

  In other words, you would do it like this:

#include "transforms.inc"

camera
{ your_camera_settings

  Axis_Rotate_Trans(<1,2,3>, 30)
}

where <1,2,3> is the axis around which you want to rotate and 30 is the
rotation amount (in degrees).

-- 
                                                          - Warp


Post a reply to this message

From: Trevor G Quayle
Subject: Re: rotating the camera
Date: 2 Aug 2006 13:45:01
Message: <web.44d0e3c34df2b2d7c150d4c10@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> shimon_a10 <shi### [at] wallacoil> wrote:
> > 1. In my question i ment that: if i want to rotate the camera around certain
> >    veactor which act as an axis (for example: rotate the camera around the
> >    line which connect the origin to the camera point).
>
>   If you just want to rotate a point (eg. the location point of the camera)
> around an arbitrary axis, you can use the vaxis_rotate() function for that:
>
> http://povray.org/documentation/view/3.6.1/229/#s02_02_01_04_05
>
>   If you want to rotate the entire camera as if it was an object, you
> can use the Axis_Rotate_Trans() function in the transforms.inc include
> file:
>
> http://povray.org/documentation/view/3.6.1/488/
>
>   In other words, you would do it like this:
>
> #include "transforms.inc"
>
> camera
> { your_camera_settings
>
>   Axis_Rotate_Trans(<1,2,3>, 30)
> }
>
> where <1,2,3> is the axis around which you want to rotate and 30 is the
> rotation amount (in degrees).
>
> --
>                                                           - Warp

I think what he's asking is to roll the camera.  In this case you want to
use the "sky" vector for the camera which tells the camera which way is up
(don't get confused by the "up" vector in the camera which is different).
this is a vector, so you can use vrotate to rotate it in your camera
statement.  See "3.3.1.1.2  The Sky Vector".

-tgq


Post a reply to this message

From: Warp
Subject: Re: rotating the camera
Date: 2 Aug 2006 15:07:13
Message: <44d0f7e1@news.povray.org>
Trevor G Quayle <Tin### [at] hotmailcom> wrote:
> I think what he's asking is to roll the camera.

  Can be done with 'rotate' too.

-- 
                                                          - Warp


Post a reply to this message

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