POV-Ray : Newsgroups : povray.animations : Camera question/Simple Animation : Re: Camera question/Simple Animation Server Time
28 Jul 2024 22:15:40 EDT (-0400)
  Re: Camera question/Simple Animation  
From:
Date: 31 Jul 1998 22:34:31
Message: <35c270a7.0@news.povray.org>
islam skrev i meddelelsen <35A### [at] icrficnetuk>...
>I would like to do very simple animations by keeping the object
>fixed at the origin and translating/rotating the camera along a
>defined curve. For example have the camera move in a circle in
>the X-Z plane. I must be doing something very silly because strange
>things start to happen after a 90degree rotation. Here is the
>psedo code for my program:
>
>/* ROTATE CAMERA AROUND Y-AXIS ABOUT ORIGIN */
>
>lxo = 0. ; lyo = 0. ; lyo = 50. /* camera start xyz location */
>rxo = 1. ; ryo = 0. ; rzo = 0.  /* right axis start xyz location */
>
>for i = start-angle , end-angle
>{
>
>create_new_pov_input_file_i
>
>/* rotate camera location and right x & z */
>
>lx = cos(i).lxo - sin(i).lzo
>lz = sin(i).lxo + cos(i).lzo
>rx = cos(i).rxo - sin(i).rzo
>rz = sin(i).rxo + cos(i).rzo
>
>write-camera:
> camera {
> location <   lx,ly,lz>
> look_at  <   0.,0.,0.>
> up       <   0.,1.,0.>
> right    <   rx,ry,rz>
> orthographic}
>
>write_out_scene_data
>
>}
>
>Any help/comments much appreciated. Thanks
>____________________________________________
>Suhail A Islam
>Biomolecular Modelling Laboratory
>Imperial Cancer Research Fund, P.O. Box 123
>44 Lincoln's Inn Fields, London WC2A 3PX
>Tel: (0171) 269 3380
>Fax: (0171) 269 3258
>email: isl### [at] icrficnetuk
>http://www.icnet.uk/bmm/
>____________________________________________

Hi there, Suhail...
Try place the whatever it is you want the camera to circle around, at the
position <0,0,0>, and then "apply" the camera like this:

camera {
    location <0,0,-5>
    look_at <0,0,0>
    rotate <0,360*clock,0>
    }

This makes the camera keep on looking at the object(s) at <0,0,0>, and make
one full circle with radius 5 around the object(s), as clock propagates from
0 to 1
This should work all 360 degrees around...

Happy tracin'...


Post a reply to this message

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