POV-Ray : Newsgroups : povray.general : Camera look_at question Server Time
13 Oct 2026 20:29:55 EDT (-0400)
  Camera look_at question (Message 1 to 22 of 22)  
From: Tom Melly
Subject: Camera look_at question
Date: 21 Jan 2004 11:26:56
Message: <400ea850@news.povray.org>
I've never really understood how to use all the different camera option - just
the basics, position, look_at, up and right (and the occasional foray into
orthographic), so if this question is bleedin' obvious, I humbly apologise.

Is there a way to make the look_at point not the centre of the image? Obviously,
I could acheive a similiar result by cropping the image once it's rendered, but
then I'm wasting time rendering parts of the image I don't intend to keep.

-- 
#macro A(V,B,C,R)#while(B-256)#if(V-128/B>=0)sphere{0,.5translate<C-4R-1,9>
pigment{rgb<1-C/8R/2C/8>}}#local V=V-128/B;#end#local B=B*2;#local C=C+1;#
end#end A(234,1,0,2)A(85,1,0,1)A(81,1,0,0)light_source{-5 1}//Tom Melly


Post a reply to this message

From: Slime
Subject: Re: Camera look_at question
Date: 21 Jan 2004 13:59:44
Message: <400ecc20$1@news.povray.org>
> Is there a way to make the look_at point not the centre of the image?
Obviously,
> I could acheive a similiar result by cropping the image once it's
rendered, but
> then I'm wasting time rendering parts of the image I don't intend to keep.

My include file zoomin.inc ( http://www.slimeland.com/misc/zoomin.inc )
makes this relatively easy to do. However, I'm not certain that it's exactly
what you want: looking in a direction A and taking a portion of an image
which is looking in direction B does not create the same effect.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Camera look_at question
Date: 21 Jan 2004 14:30:13
Message: <400ed345$1@news.povray.org>
> Is there a way to make the look_at point not the centre of the image? Obviously,
> I could acheive a similiar result by cropping the image once it's rendered, but
> then I'm wasting time rendering parts of the image I don't intend to keep.

	Why not to use the +sr +er +sc +ec switches ?

	It effectively crops the image by rendering the part you are interested in,
which does not need to be centered around the whole image center (pan effect).
The missing portions of the image (black areas) still need to be manually removed
in your favorite image editor (usual select/copy/paste in new image).

	- NC


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Camera look_at question
Date: 21 Jan 2004 15:03:08
Message: <400edafc@news.povray.org>
> Is there a way to make the look_at point not the centre of the image?
Obviously,
> I could acheive a similiar result by cropping the image once it's
rendered, but
> then I'm wasting time rendering parts of the image I don't intend to keep.

Well, the point of look_at is to provide a center on which the image
focusses. For the actual camera focus, focal-blur using a different
focal_point might achieve what you're after, since it can effectively blur
the look_at position (given the right scene).

Aside of that, how about moving look_at somewhere else? I don't get why
you'd want the camera to behave irrationally and look at something different
than look_at. :-S

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de


Post a reply to this message

From: Jim Charter
Subject: Re: Camera look_at question
Date: 21 Jan 2004 15:18:47
Message: <400edea7@news.povray.org>
Tom Melly wrote:
> I've never really understood how to use all the different camera option - just
> the basics, position, look_at, up and right (and the occasional foray into
> orthographic), so if this question is bleedin' obvious, I humbly apologise.
> 
> Is there a way to make the look_at point not the centre of the image? Obviously,
> I could acheive a similiar result by cropping the image once it's rendered, but
> then I'm wasting time rendering parts of the image I don't intend to keep.
> 
Whatever you intend to keep has a center, doesn't it?


Post a reply to this message

From: Severi Salminen
Subject: Re: Camera look_at question
Date: 21 Jan 2004 17:29:14
Message: <400efd3a$1@news.povray.org>
> Well, the point of look_at is to provide a center on which the image
> focusses. For the actual camera focus, focal-blur using a different
> focal_point might achieve what you're after, since it can effectively blur
> the look_at position (given the right scene).
>
> Aside of that, how about moving look_at somewhere else? I don't get why
> you'd want the camera to behave irrationally and look at something
different
> than look_at. :-S

For the same reason as large format cameras have the ability to move the
film plane (shifting) so that the center axis of the lens does not point at
the center of the film. This allows quite interesting (and many times very
useful) perspective corrections/alterations. It is not about focal blur. I
think this is what Tom wants to accomplish? Basically this can be
accomplished by rendering only a portion of a larger image, but it is an
"ugly" way to do it.

POV-Ray lacks a couple more or less useful things such as defining the
direction focus plane when using focal blur, the shifting (as above) etc.
These would be useful things to add at some point.

Severi Salminen


Post a reply to this message

From: Tom Melly
Subject: Re: Camera look_at question
Date: 22 Jan 2004 04:12:35
Message: <400f9403$1@news.povray.org>
"Nicolas Calimet" <pov### [at] freefr> wrote in message
news:400ed345$1@news.povray.org...
> > Is there a way to make the look_at point not the centre of the image?
Obviously,
> > I could acheive a similiar result by cropping the image once it's rendered,
but
> > then I'm wasting time rendering parts of the image I don't intend to keep.
>
> Why not to use the +sr +er +sc +ec switches ?
>

An obvious solution that completely eluded me. Doh!


Post a reply to this message

From: Tom Melly
Subject: Re: Camera look_at question
Date: 22 Jan 2004 04:34:58
Message: <400f9942$1@news.povray.org>
"Tim Nikias v2.0" <tim.nikias (@) nolights.de> wrote in message
news:400edafc@news.povray.org...
>
> Well, the point of look_at is to provide a center on which the image
> focusses. For the actual camera focus, focal-blur using a different
> focal_point might achieve what you're after, since it can effectively blur
> the look_at position (given the right scene).

The effect I'm after isn't really anything to do with focal-blur.

> Aside of that, how about moving look_at somewhere else? I don't get why
> you'd want the camera to behave irrationally and look at something different
> than look_at. :-S

To be honest, I'm not *entirely* sure myself - except to say that I want the
subject of my image to not be in the centre of the image, and not distorted by
being elsewhere. I've posted an image to binaries.images (look_at image) to show
the effect (note the distorted/undistorted sphere - heh, well hard to miss it;).


Post a reply to this message

From: Philippe Debar
Subject: Re: Camera look_at question
Date: 22 Jan 2004 06:09:02
Message: <400faf4e@news.povray.org>
You could check POV-Ray 3.5/scenes/camera/shear.pov

Don't forget to disable vista buffers (-uv)

Otherwise, partial output is the way to go.

I hope this helps,

Povingly,

Philippe


Post a reply to this message

From: Jim Charter
Subject: Re: Camera look_at question
Date: 22 Jan 2004 09:06:40
Message: <400fd8f0$1@news.povray.org>
Severi Salminen wrote:
>>Well, the point of look_at is to provide a center on which the image
>>focusses. For the actual camera focus, focal-blur using a different
>>focal_point might achieve what you're after, since it can effectively blur
>>the look_at position (given the right scene).
>>
>>Aside of that, how about moving look_at somewhere else? I don't get why
>>you'd want the camera to behave irrationally and look at something
> 
> different
> 
>>than look_at. :-S
> 
> 
> For the same reason as large format cameras have the ability to move the
> film plane (shifting) so that the center axis of the lens does not point at
> the center of the film. This allows quite interesting (and many times very
> useful) perspective corrections/alterations. It is not about focal blur. I
> think this is what Tom wants to accomplish? Basically this can be
> accomplished by rendering only a portion of a larger image, but it is an
> "ugly" way to do it.
> 
> POV-Ray lacks a couple more or less useful things such as defining the
> direction focus plane when using focal blur, the shifting (as above) etc.
> These would be useful things to add at some point.
> 
> Severi Salminen
> 
Ah I get it now.  Divorse the lens perspective from the frame of the 
picture.


Post a reply to this message

From: Tom Melly
Subject: Re: Camera look_at question
Date: 22 Jan 2004 10:14:40
Message: <400fe8e0$1@news.povray.org>
"Jim Charter" <jrc### [at] msncom> wrote in message
news:400fd8f0$1@news.povray.org...

> Ah I get it now.

From Severi or from the image in binaries.images?

>  Divorse

Either you can't spell, or Dolly Parton has a lot of re-recording to do....


Post a reply to this message

From: Rune
Subject: Re: Camera look_at question
Date: 22 Jan 2004 10:38:56
Message: <400fee90$1@news.povray.org>
Philippe Debar wrote:
> You could check POV-Ray 3.5/scenes/camera/shear.pov

Ah yes, I was going to point out applying a matrix to the camera. Didn't
know there was a sample scene for it though. That's neat. :)

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com **updated Dec 30**
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Tom Melly
Subject: Re: Camera look_at question
Date: 22 Jan 2004 10:48:13
Message: <400ff0bd$1@news.povray.org>
"Rune" <run### [at] runevisioncom> wrote in message
news:400fee90$1@news.povray.org...
> Philippe Debar wrote:
> > You could check POV-Ray 3.5/scenes/camera/shear.pov
>
> Ah yes, I was going to point out applying a matrix to the camera. Didn't
> know there was a sample scene for it though. That's neat. :)
>

Gimme about 6 million years and I might understand how that works... IMHO Neo
had it easy.


Post a reply to this message

From: Severi Salminen
Subject: Re: Camera look_at question
Date: 22 Jan 2004 11:02:59
Message: <400ff433$1@news.povray.org>
Tom Melly wrote:
> "Jim Charter" <jrc### [at] msncom> wrote in message
> news:400fd8f0$1@news.povray.org...
> 
> 
>>Ah I get it now.
> 
> 
> From Severi or from the image in binaries.images?

Both, I think, because you are doing exactly what I tried to explain ;) 
And that can be achieved at least by cropping (or rendering only a 
certain region), as you did in your example.

The trick is very useful when, for example, you try to take a photograph 
of a building.

1. If you level your camera and point it straight forward, you might not 
see the top portion of the building.

2. If you point the camera upwards, the building does not look 
rectangular anymore: all the lines start to "converge".

3. If you level your camera, point it straight forward (as in no 1.), 
and shift the film lower (maintaining the alignment) in relation to the 
lens, you will see the whole building with straigh walls that do not 
converge.

I posted 3 simple examples at p.b.i. They are all rendered so that the 
camera is allways at the same spot.

Severi Salminen


Post a reply to this message

From: Tom Melly
Subject: Re: Camera look_at question
Date: 22 Jan 2004 11:40:20
Message: <400ffcf4$1@news.povray.org>
"Severi Salminen" <sev### [at] NOT_THISsibafi> wrote in message
news:400ff433$1@news.povray.org...
>
> I posted 3 simple examples at p.b.i. They are all rendered so that the
> camera is allways at the same spot.

Nice examples. Did you crop* or use the camera-matrix method?

* either by post-process cropping or +sr etc switches


Post a reply to this message

From: Jim Charter
Subject: Re: Camera look_at question
Date: 22 Jan 2004 11:41:46
Message: <400ffd4a$1@news.povray.org>
Tom Melly wrote:

> 
> From Severi or from the image in binaries.images?
> 

Well it all came to me as I read the posts and each reinforcing each 
other.  Actually I originally had a glimpse of understanding but didn't 
want to believe it.  I admit is has some interesting associations, like 
looking obliquely from the window of a moving car.  The movement, road 
etc. seems to compel one sense of perspective while your eyes insist on 
another.

> 
>> Divorse
> 
> 
> Either you can't spell, or Dolly Parton has a lot of re-recording to do....
> 
> 
Yeah I thought it was wrong.  Still not sure how to fix it. "c" instead 
of "s"?  Gawd what a morning.  Divorce?  Want it? Fear it? Sure as hell 
can't spell it!  Let's write (right?) a song ourselves.


Post a reply to this message

From: Severi Salminen
Subject: Re: Camera look_at question
Date: 22 Jan 2004 11:45:42
Message: <400ffe36@news.povray.org>
Tom Melly wrote:
>>I posted 3 simple examples at p.b.i. They are all rendered so that the
>>camera is allways at the same spot.
> 
> 
> Nice examples. Did you crop* or use the camera-matrix method?
> 
> * either by post-process cropping or +sr etc switches

It was a simple post process crop. For the 3rd image I defined up 2*y 
and rendered using +h480 and cropped the correct portion.

Severi S.


Post a reply to this message

From: Philippe Debar
Subject: Re: Camera look_at question
Date: 22 Jan 2004 17:15:32
Message: <40104b84@news.povray.org>
What is the problem ? Understanding shearing, the matrix or how to set 
up the camera ? If you know how you need to set up your camera vectors, 
you can do this directly and need not to use matrix.

Here is an example of a camera that automatically eliminates the 
vertical vanishing point :


camera{
   // Desc: Camera that eliminates vertical vanishing point
   // Date: 25 juillet 2002
   // Auth: Philippe Debar phd### [at] yahoofr

   #local Camera_Location = <-3,.01,-3>;
   /* as the standard "location" */

   #local Camera_Up       =  1 ;
   /* almost as the standard "up" : use a number (scalar) instead of a 
vector */

   #local Camera_Right    =  image_width/image_height ;
   /* almost as the standard "right" : use a number (scalar) instead of 
a vector  */

   #local Camera_Zoom     =  1 ;
   /*  almost as the standard "direction" : use a number (scalar) 
instead of a vector  */

   #local Camera_Look_At  = <-.5,2,.5> ;
   /* as the standard "look_at" */



   #ifndef(Shear_Trans) #include "transforms.inc" #end
   location 0
   up Camera_Up*y
   right Camera_Right*x
   direction
     vnormalize(
 
(Camera_Look_At.y-Camera_Location.y)/vlength((Camera_Look_At-Camera_Location)*<1,0,1>)*y
       + z
       )
     * Camera_Zoom
   Reorient_Trans(z, (Camera_Look_At-Camera_Location)*<1,0,1>)
   translate Camera_Location
}


You need to disable vista buffers to use this (option -uv).

I'll gladly explain anything that seems to be obscure.


Povingly,

Philippe


Tom Melly wrote:
> "Rune" <run### [at] runevisioncom> wrote in message
> news:400fee90$1@news.povray.org...
> 
>>Philippe Debar wrote:
>>
>>>You could check POV-Ray 3.5/scenes/camera/shear.pov
>>
>>Ah yes, I was going to point out applying a matrix to the camera. Didn't
>>know there was a sample scene for it though. That's neat. :)
>>
> 
> 
> Gimme about 6 million years and I might understand how that works... IMHO Neo
> had it easy.
> 
>


Post a reply to this message

From: Tom Melly
Subject: Re: Camera look_at question
Date: 23 Jan 2004 04:46:12
Message: <4010ed64$1@news.povray.org>
"Philippe Debar" <phd### [at] wanadoobe> wrote in message
news:40104b84@news.povray.org...
> What is the problem ? Understanding shearing,

Yes - but I can at least see what it does (sort of - I don't really understand
why it helps so much with the perspective problem)

> the matrix

Yes - although, like quantum physics, it makes sense for about 5 mins after
reading that faq on 'em.

> or how to set up the camera ?

Yes - this is where I really get into trouble. I've read the docs on the camera
several times, and still can't get my head around the various options and how
they interact.


Post a reply to this message

From: gonzo
Subject: Re: Camera look_at question
Date: 23 Jan 2004 22:36:11
Message: <4011e82b@news.povray.org>
Severi Salminen <sev### [at] NOT_THISsibafi> wrote in message
news:400ff433
> The trick is very useful when, for example, you try to take a photograph
> of a building.
>
> 1. If you level your camera and point it straight forward, you might not
> see the top portion of the building.
>
> 2. If you point the camera upwards, the building does not look
> rectangular anymore: all the lines start to "converge".
>
> 3. If you level your camera, point it straight forward (as in no 1.),
> and shift the film lower (maintaining the alignment) in relation to the
> lens, you will see the whole building with straigh walls that do not
> converge.


If this is what you trying for, John Guthkelch wrote a Field Camera Macro to
do exactly that. Search the older posts by author for Dr. John and you
should find it.  I used it in my IRTC architecture entry and it worked quite
well.

RG


Post a reply to this message

From: Philippe Debar
Subject: Re: Camera look_at question
Date: 24 Jan 2004 10:45:40
Message: <40129324@news.povray.org>
Tom Melly wrote:

>>What is the problem ? Understanding shearing,
> Yes - but I can at least see what it does (sort of - I don't really understand
> why it helps so much with the perspective problem)

What is needed to solve the perspective problem is to set up
non-perpendicular right, up and direction camera vectors. Shearing
allows to do exactly that : when you shear a box, edges that were
perpendicular (may) form another angle.

However, shearing isn't _required_ as you can set your vectors the way you
need them directly.

>>the matrix
> Yes - although, like quantum physics, it makes sense for about 5 mins after
> reading that faq on 'em.

Whenever I try to use the matrix keyword, I need to re-rtfm. Then fail
some times before succeeding.

>>or how to set up the camera ?
> Yes - this is where I really get into trouble. I've read the docs on the camera
> several times, and still can't get my head around the various options and how
> they interact.

Ok, I'll try to explain.

A (perspective) camera only really needs four vector parameters : 
location, up, right
and direction.

sky, look_at and angle are only tools to set up the four needed vectors.

Usually, and whenever you use look_at, the right, up and direction
vectors are perpendicular (just like x, y, z - in that order).

I feel that the best explanation to understand how the camera works is 
to use a real world example.

Some people, wanting to explore the effects of perspective, use the 
following setup : they paint what they can see trough a pane of glass on 
the glass itself. The camera works almost exactly in the same way.

location defines where the painter is standing in the scene - more 
exactly where his eye is set (supposing the other eye is closed).

right, up and direction define the position and dimensions of the pane 
of glass.

right measures the horizontal side of the glass pane, up it's vertical 
side. As up and right are vectors, they define the size and the 
orientation of the glass pane in one go.

direction is the vector joining the eye of the painter (=location) to 
the center of the pane. Hence, it defines the pane position (relative to 
the painter ; location + direction is the absolute pane's position).

look_at make the pane of glass rotate around the painter's eye. To 
achieve this it changes the value of up, right and direction. sky is 
used to determine how to rotate (keeping one's up up)

How much of the scene is painted depends on the relation between 
direction and the size of the pane (= right and up). If you multiply 
right, up and direction by a same number, the resulting image is left 
unchanged.

angle measures (and affects) the direction/right ratio.


If right and up aren't perpendicular, this means that the painter is 
using a parallelogram of glass to paint on. However, as pov always draw 
the image in a rectangle, the parallelogram is sheared onto the 
rectangle, producing a skewed image.


If direction is perpendicular to right and up, the center of the image 
is the point that is the nearest to the painter, and the intersection of 
the perpendicular traced from the painter to the pane, and the pane.

Setting direction non-perpendicular to right and up is like making the 
glass pane slide in it's own plane : the painter isn't painting around 
the center anymore. This is exactly like using a partial render of a 
larger image.


If you want to experiment with sheared cameras, that is cameras with 
non-perpendicular right, up and direction, you have to remember (1) to 
disable vista buffers with -uv and (2) that using look_at straighten 
right, up and direction back to perpendicular, so you need either to set 
up the right, up, direction vectors directly and avoid look_at or to use 
look_at and then shear the camera.


I hope I did not make any error and that this helps...

Povingly,

Philippe


Post a reply to this message

From: Tom Melly
Subject: Re: Camera look_at question
Date: 27 Jan 2004 10:05:14
Message: <40167e2a@news.povray.org>
"Philippe Debar" <phd### [at] wanadoobe> wrote in message
news:40129324@news.povray.org...

<snip>

Many thanks - printed and filed...


Post a reply to this message

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