POV-Ray : Newsgroups : povray.general : Camera look_at question Server Time
3 Aug 2024 18:23:00 EDT (-0400)
  Camera look_at question (Message 13 to 22 of 22)  
<<< Previous 10 Messages Goto Initial 10 Messages
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

<<< Previous 10 Messages Goto Initial 10 Messages

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