POV-Ray : Newsgroups : povray.general : Help with camera declarations : Re: Help with camera declarations Server Time
12 Aug 2024 21:25:23 EDT (-0400)
  Re: Help with camera declarations  
From: John VanSickle
Date: 9 Jan 1999 14:39:38
Message: <3697B103.5AB61553@erols.com>
Mike Metheny wrote:
> 
> When working through a scene, I usually want to zoom in on various parts of
> my scene.  Right now I have various camera declarations commented out using
> /* */, and switch between them as needed.  How do I declare various camera
> positions/lookats in one easy declaration so i can just change camera_1 to
> camera_2 or whatever to switch?  I hope I'm making myself clear.

In my animations I use code like this:

#declare CamL=<0,0,-10>;
#declare CamF=<0,0,0>;
#declare CamZ=2.5;
#declare CamS=y;

#if (clock>=4)
#declare CamF=<1000,.25,0>-z*(clock-4)*10;
#declare CamL=CamF+<250,125,249>;
#end

#if (clock>=11)
#declare CamL=CamF+Transition(<250,125,249>,<25,12.5,24.9>,0*y,(clock-11)/4);
#end

#declare CamD=vnormalize(CamE-CamL);
#declare CamR=vnormalize(vcross(CamS,CamD));
#declare CamU=vnormalize(vcross(CamD,CamR));

camera {
  up        CamU
  right     CamR*4/3
  direction CamD*CamZ
  location  CamL
}

The macro Transition() is used for smoothly transitioning from one value
to another; you can find out more about it on my Thoroughly Useful Macros
page at http://www.erols.com/vansickl/macs.htm .

I go to the trouble of declaring CamR, CamD, CamU, etc, so that I can
use them later to place subtitles in the scenes (using another one of
my Thoroughly Useful Macros makes this *very* easy).

Hope this helps,
John


Post a reply to this message

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