POV-Ray : Newsgroups : povray.general : Help with camera declarations Server Time
12 Aug 2024 19:35:38 EDT (-0400)
  Help with camera declarations (Message 1 to 8 of 8)  
From: Mike Metheny
Subject: Help with camera declarations
Date: 6 Jan 1999 01:49:07
Message: <36930763.0@news.povray.org>
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.

Thanks guys!



Mike Metheny
lon### [at] vtedu
http://loneshepherd.ml.org/

"When one's words are no better than silence, one should keep silent."


Post a reply to this message

From: Ken
Subject: Re: Help with camera declarations
Date: 6 Jan 1999 02:31:13
Message: <369310C9.C5ECDB85@pacbell.net>
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.
> 
> Thanks guys!
> 
> Mike Metheny


You can do it like this --

#declare Loc1 = <0,1,-10>;
#declare Loc2 = <1,1,-10>;
#declare Loc3 = <0,1,-15>;
#declare Loc4 = <1,1,-18>;
#declare Loc5 = <1,1,-17>;

#declare Look1 = <0,1,1>;
#declare Look2 = <1,1,1>;
#declare Look3 = <0,1,5>;
#declare Look4 = <1,1,9>;
#declare Look5 = <1,1,5>;

camera{location Loc1 look_at Look1}

This way once you have adjusted the numbers in the vectors
in the #declared statments you need change only two numbers,
for Loc and Look, and you have a new view.

-- 
Ken Tyler

tyl### [at] pacbellnet


Post a reply to this message

From: Bob Hughes
Subject: Re: Help with camera declarations
Date: 6 Jan 1999 03:19:41
Message: <36931C62.1FA87297@aol.com>
To add to Kens help:
You can also put this together with a #switch. It just gets more lengthy
script-wise but once made saves time. Making a comment line showing a
listing of what's-what for each switchable view helps too.

//BEGIN
#declare CLL = 1; //use one of the numbered sets from below.

 #declare Loc1 = <0,1,-10>;
 #declare Loc2 = <1,1,-10>;
 #declare Loc3 = <0,1,-15>;
 #declare Loc4 = <1,1,-18>;
 #declare Loc5 = <1,1,-17>;
 
 #declare Look1 = <0,1,1>;
 #declare Look2 = <1,1,1>;
 #declare Look3 = <0,1,5>;
 #declare Look4 = <1,1,9>;
 #declare Look5 = <1,1,5>;
 
 camera{
 location
#switch (CLL) //your switchable parameter
#case (1)
 Loc1
#break
#case (2)
 Loc2
#break
#case (3)
 Loc3
#break
#case (4)
 Loc4
#break
#case (5)
 Loc5
#break
#end

 look_at
#switch (CLL)
#case (1)
 Look1
#break
#case (2)
 Look2
#break
#case (3)
 Look3
#break
#case (4)
 Look4
#break
#case (5)
 Look5
#break
#end

}
//END

Ken wrote:
> 
> 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.
> >
> > Thanks guys!
> >
> > Mike Metheny
> 
> You can do it like this --
> 
> #declare Loc1 = <0,1,-10>;
> #declare Loc2 = <1,1,-10>;
> #declare Loc3 = <0,1,-15>;
> #declare Loc4 = <1,1,-18>;
> #declare Loc5 = <1,1,-17>;
> 
> #declare Look1 = <0,1,1>;
> #declare Look2 = <1,1,1>;
> #declare Look3 = <0,1,5>;
> #declare Look4 = <1,1,9>;
> #declare Look5 = <1,1,5>;
> 
> camera{location Loc1 look_at Look1}
> 
> This way once you have adjusted the numbers in the vectors
> in the #declared statments you need change only two numbers,
> for Loc and Look, and you have a new view.
> 
> --
> Ken Tyler
> 
> tyl### [at] pacbellnet

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.htm
=Bob


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

From: Ken
Subject: Re: Help with camera declarations
Date: 6 Jan 1999 03:29:49
Message: <36931E87.BFC2A8C6@pacbell.net>
Bob Hughes wrote:
> 
> To add to Kens help:
> You can also put this together with a #switch. It just gets more lengthy
> script-wise but once made saves time. Making a comment line showing a
> listing of what's-what for each switchable view helps too.

 I can see where using #switch syntax would be time saving
if there were multiple changes being made by doing so.
In this case where you need only type over two numbers for
the desired change I think I will stick with my method.

-- 
Ken Tyler

tyl### [at] pacbellnet


Post a reply to this message

From: Michael Andrews
Subject: Re: Help with camera declarations
Date: 6 Jan 1999 05:44:15
Message: <36933E3F.5194D349@remove-this.reading.ac.uk>
Bob Hughes wrote:

> To add to Kens help:
> You can also put this together with a #switch. It just gets more lengthy
> script-wise but once made saves time. Making a comment line showing a
> listing of what's-what for each switchable view helps too.
>
> //BEGIN
> #declare CLL = 1; //use one of the numbered sets from below.
>
>  #declare Loc1 = <0,1,-10>;
>  #declare Loc2 = <1,1,-10>;
>  #declare Loc3 = <0,1,-15>;
>  #declare Loc4 = <1,1,-18>;
>  #declare Loc5 = <1,1,-17>;
>
>  #declare Look1 = <0,1,1>;
>  #declare Look2 = <1,1,1>;
>  #declare Look3 = <0,1,5>;
>  #declare Look4 = <1,1,9>;
>  #declare Look5 = <1,1,5>;
>

Why not just use arrays?

For instance

#declare Location = array[ 5 ] {
    <0,1,-10>,
    <1,1,-10>,
    <0,1,-15>,
    <1,1,-18>,
    <1,1,-17>
}

#declare LookAt = array [ 5 ] {
    <0,1,1>,
    <1,1,1>,
    <0,1,5>,
    <1,1,9>,
    <1,1,5>
}

#declare CamNo = 1;

camera { location Location[CamNo] look_at LookAt[CamNo] }

Or, if the cameras are very different:

#declare Camera = array [ 5 ]

#declare Camera[0] = camera { location ... look_at ... direction ... }
#declare Camera[1] = camera { orthographic right ... up ... }
#declare Camera[2] = camera { angle ... }
...

camera { Camera[CamNo] }

    Just my thoughts on the matter,
        Mike Andrews.


Post a reply to this message

From: Ron Parker
Subject: Re: Help with camera declarations
Date: 6 Jan 1999 12:13:32
Message: <369399bc.0@news.povray.org>
On Tue, 05 Jan 1999 23:29:13 -0800, Ken <tyl### [at] pacbellnet> wrote:
>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.
>> 
>> Thanks guys!
>> 
>> Mike Metheny
>
>
>You can do it like this --

Ahem... From the POV-Ray documentation, under "camera identifiers":

#declare Long_Lens =
  camera {
   location -z*100
   angle 3
  }
#declare Short_Lens =
  camera {
   location -z*50
   angle 15
  }
camera {
  Long_Lens  // edit this line to change lenses
  look_at Here
  }


Post a reply to this message

From: Daren Scot Wilson
Subject: Re: Help with camera declarations
Date: 8 Jan 1999 23:43:28
Message: <36969834.2F00BFB9@pipeline.com>
Mike Metheny wrote:
> 
>  How do I declare various camera
> positions/lookats in one easy declaration so i can just change ...?


Ugh!  Ignore the solutions others have posted, for I am your saviour and
offer the one true way...


Here's what I do (put on your sunglasses, this is brilliant!)


---------- BEGIN CAMERA WISDOM -----------

#declare FinalCamera = camera {
       location  <-1.2*OneFoot-epsilon, 1.7*OneFoot+BenchTopY,
-2.5*OneFoot>
       look_at  <VisePlateSeparation *.4 - 0.7*OneFoot,    
ViseHeight*.7+BenchTopY, BenchFrontZ>
       angle 63
}

#declare FlourCamera = camera {
       location  <-epsilon, 1.7*OneFoot+BenchTopY, -4*OneFoot>
       look_at  <VisePlateSeparation *.4,   .40+ 
ViseHeight*.7+BenchTopY, BenchFrontZ>
       angle 75
}
#declare PlanCamera = camera {
       location  <-epsilon, CeilingY-OneFoot,  0>
       look_at  <0,   BenchTopY, BenchFrontZ>
       angle 94
       orthographic
}

#declare EndView = camera {
	location < LeftWallX+OneFoot, ViseMoundRelY, 0>
	look_at  < 0, ViseMoundRelY, 0>
	angle 50
}


#declare BackWallCam = camera {
	location < -OneFoot, BenchTopY+2*OneFoot, OneFoot>
	look_at < -OneFoot,  BenchTopY+OneFoot, BackWallZ>
	angle 101
}

#declare DramaCam = camera {
	location < -OneFoot, BenchTopY+ 10, -10>
	look_at < -OneFoot,  BenchTopY+OneFoot, BackWallZ>
	angle 90
}


//camera { FinalCamera }
//camera { FlourCamera }
//camera { PlanCamera }
//camera { EndView }
//camera  {BackWallCam }
camera { DramaCam }


------ END OF CAMERA EXAMPLE -------


Just uncomment one line, comment out all others.   The names remind me
of what each one is for. There's always FinalCamera, or FinalView, for
the finished product, several Check cameras, and some aimed at special
objects while I'm modelling and texturing them, like BackWallCam. 
Rarely, I use PlanCamera to show a top-view floor plan of everything,
but most scenes come together without need for that.  This scene had a
2nd FinalView that was more dramatic, called DramaCam.  So much fun, so
little time...


Gee, I hope I didn't sound biased, I did my best to be objective,
hee-hee-hee!

-- 
Daren Scot Wilson
dar### [at] pipelinecom 
www.newcolor.com
----
"A ship in a harbor is safe, but that is not what ships are built for"
                                            -- William Shedd


Post a reply to this message

From: John VanSickle
Subject: Re: Help with camera declarations
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.