POV-Ray : Newsgroups : povray.general : Custom reference point for perspective camera? Server Time
1 Nov 2024 11:14:57 EDT (-0400)
  Custom reference point for perspective camera? (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Jonathan
Subject: Custom reference point for perspective camera?
Date: 20 Oct 2004 18:05:00
Message: <web.4176e00d17c5306fd114d2650@news.povray.org>
We all know that perspective projection is for projecting on a flat
surface, and that the perspective reference point is at the center. But
what if you want to make 'perfect' cross-eyed stereo renderings, like
me?

First, you need some input values and math to position the camera
correctly. The math instantly shows that the perspective reference point
isn't at the center, not even inside the image. So how are you going to
do that in POV-Ray?

You can make the image over twice as wide, position the camera
differently and finally cut out the part you need (manually switching
left and right for each rendering), losing some precision of the
perspective reference point (not much though). If you think that
workaround is easy, try for yourself.

I'd suggest a customizable reference point offset in 2D from the center,
and in 3D like the focal point (NOT doing pointless FOV correction). For
now, does anyone know a more straightforward way?

Jonathan


Post a reply to this message

From: Slime
Subject: Re: Custom reference point for perspective camera?
Date: 20 Oct 2004 20:11:54
Message: <4176feca$1@news.povray.org>
> We all know that perspective projection is for projecting on a flat
> surface, and that the perspective reference point is at the center.

I'm not sure what you mean by the "perspective reference point," unless
you're referring to the point specified by the look_at keyword. Assuming
that's the case...

> The math instantly shows that the perspective reference point
> isn't at the center, not even inside the image. So how are you going to
> do that in POV-Ray?

A matrix transformation can be used to shear the camera. This can offset the
look_at point from the center of the image. Shear the camera on the left so
that it's looking to the right (without changing the normal of the
perspective plane) and the camera on the right so that it's looking to the
left, and I think that's the effect you're looking for. A little knowledge
about matrix transformations and it shouldn't even be too difficult to
construct the right one:

camera {
// start by looking in the z-direction
location 0
look_at z

// shear sideways
matrix <
1,0,0,
0,1,0,
shear_amount,0,1,
0,0,0
>
translate eye_pos*x
}

Where shear_amount is the tangent of the angle between foward (z) and the
direction you want the center of the image to be in; and eye_pos is the
horizontal offset of the camera from the center of the "eyes" of the
"viewer" (one camera would be to the right, the other to the left). You can
then rotate and translate the cameras to whatever position you want them in.

Unfortunately, as this creates non-perpendicular camera vectors, you have to
turn off vista buffers in the command line (-UV). The fact that this camera
is just an offset from a normal perspective camera leads me to believe that
vista buffers *could* work with it (as long as the right and up vectors are
perpendicular), but apparently POV-Ray is not programmed to handle this
case.

Finally, one last point:

> But
> what if you want to make 'perfect' cross-eyed stereo renderings, like
> me?

There is an impossibility in creating "perfect" stereo renderings. In real
life, when you look at objects at different distances, your eyes rotate to
look at them (going slightly cross-eyed for closer objects). Your image,
however, can't rotate like a viewer's eye just because they're focusing on a
different part of the image. Therefore, you can only plan your image out
with a certain reference point in mind: the point in 3D space which is on
the same 2D position in both images. Everywhere else the viewer looks will
cause their peripheral vision to be (very slightly) different than what they
would see in real life, because the camera doesn't rotate the way their eyes
rotate.

This difference is about the same as the difference that you're trying to
avoid by using fancy camera shapes, so I'm not sure it's really worth the
effort. I'm also not convinced that the sheared cameras will actually be an
improvement over having both cameras look_at a central point.

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


Post a reply to this message

From: Jonathan
Subject: Re: Custom reference point for perspective camera?
Date: 20 Oct 2004 21:40:01
Message: <web.417712bdcdaafef5d114d2650@news.povray.org>
Slime wrote:
> > We all know that perspective projection is for projecting on a flat
> > surface, and that the perspective reference point is at the center.
>
> I'm not sure what you mean by the "perspective reference point," unless
> you're referring to the point specified by the look_at keyword. Assuming
> that's the case...

The perspective reference point is the point perspective stuff is based
on. So everything else you said didn't help me at all. :-( Maybe I can
render a few examples tomorrow.

Jonathan


Post a reply to this message

From: Slime
Subject: Re: Custom reference point for perspective camera?
Date: 20 Oct 2004 21:52:18
Message: <41771652$1@news.povray.org>
> The perspective reference point is the point perspective stuff is based
> on. So everything else you said didn't help me at all. :-( Maybe I can
> render a few examples tomorrow.

Do you mean the vanishing point?

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


Post a reply to this message

From: Slime
Subject: Re: Custom reference point for perspective camera?
Date: 20 Oct 2004 21:59:35
Message: <41771807$1@news.povray.org>
> > The perspective reference point is the point perspective stuff is based
> > on. So everything else you said didn't help me at all. :-( Maybe I can
> > render a few examples tomorrow.
>
> Do you mean the vanishing point?


Oh, ok. I looked it up and I see that the perspective reference point is the
location of the camera.

It should be possible to use the method I described nonetheless; by skewing
the direction the camera is looking in, and then translating the camera the
opposite amount, you will have essentially moved the camera location (the
perspective reference point) without moving the image plane.

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


Post a reply to this message

From: Le Forgeron
Subject: Re: Custom reference point for perspective camera?
Date: 21 Oct 2004 04:11:36
Message: <Xns958967B17611Ejgrimbertmeandmyself@203.29.75.35>


> We all know that perspective projection is for projecting on a flat
> surface, and that the perspective reference point is at the center.
> But what if you want to make 'perfect' cross-eyed stereo renderings,
> like me?
> 
> First, you need some input values and math to position the camera
> correctly. The math instantly shows that the perspective reference
> point isn't at the center, not even inside the image. So how are you
> going to do that in POV-Ray?

> I'd suggest a customizable reference point offset in 2D from the
> center, and in 3D like the focal point (NOT doing pointless FOV
> correction). For now, does anyone know a more straightforward way?

Are you trying to emulate things like 6x9 photo (with bascule (seesaw ?)
and vertical/horizontal movement of the lens ?).

Or am I totally misleaded ?

Wasn't there a patch for a user-defined camera somewhere ?


-- 




l'habillement, les chaussures que le maquillage et les accessoires.


Post a reply to this message

From: Paul Bourke
Subject: Re: Custom reference point for perspective camera?
Date: 21 Oct 2004 07:51:46
Message: <pdb_NOSPAM-504680.21514721102004@news.povray.org>
> We all know that perspective projection is for projecting on a flat
> surface, and that the perspective reference point is at the center. But
> what if you want to make 'perfect' cross-eyed stereo renderings, like
> me?

I create stereoscopic rendering "all the time" using PovRay, 
indeed some of the content is for this
   http://www.vroom.org.au
   http://astronomy.swin.edu.au/~pbourke/stereographics/vroom/
but also for daily visualisation. The basic approach I use 
involves image trimming, it is easy to set up a processing
pipline to deal with this. See
   http://astronomy.swin.edu.au/~pbourke/povray/raystereo/

-- 
Paul Bourke
pdb_NOSPAMswin.edu.au


Post a reply to this message

From: Jonathan
Subject: Re: Custom reference point for perspective camera?
Date: 21 Oct 2004 08:15:00
Message: <web.4177a747cdaafef5d114d2650@news.povray.org>
Slime wrote:
> > > The perspective reference point is the point perspective stuff is based
> > > on. So everything else you said didn't help me at all. :-( Maybe I can
> > > render a few examples tomorrow.
> >
> > Do you mean the vanishing point?
>
> Oh, ok. I looked it up and I see that the perspective reference point is the
> location of the camera.

Good idea to look it up. :-) There are several ways to see
the reference point, but I had to come up with a name.

> It should be possible to use the method I described nonetheless; by skewing
> the direction the camera is looking in, and then translating the camera the
> opposite amount, you will have essentially moved the camera location (the
> perspective reference point) without moving the image plane.

Somehow I feel it is impossible to do this right, but I don't know much
about the matrix. Google isn't very helpful because of another matrix.

Jonathan


Post a reply to this message

From: Lazarus Plath
Subject: Re: Custom reference point for perspective camera?
Date: 21 Oct 2004 11:21:04
Message: <qqazxxsw-710F8D.10210021102004@news.povray.org>
In article <web.4177a747cdaafef5d114d2650@news.povray.org>,
 "Jonathan" <nomail@nomail> wrote:

> Somehow I feel it is impossible to do this right,

here's another link to look at
http://www.cip.physik.uni-muenchen.de/~wwieser/render/stereo/create.html
has pov code

Also, about the look_at point. I had a friend that was very much into 
stereo photographs. When I was making some he said it's better to not 
have the camera point at something but should be looking out parallel, 
causes less eye strain. There were lots of other technical info he had 
but this is the only that stuck with me. I just shift the camera to the 
side keeping it parallel and compose those two images. Our brains are 
always working with distorted input, it's used to things being different 
sizes etc. -laz


Post a reply to this message

From: ABX
Subject: Re: Custom reference point for perspective camera?
Date: 21 Oct 2004 12:12:45
Message: <mvnfn0pmka091fkg48gv7c9m4q2eroq57i@4ax.com>
On Wed, 20 Oct 2004 18:00:45 EDT, "Jonathan" <nomail@nomail> wrote:
> I'd suggest a customizable reference point offset in 2D from the center,
> and in 3D like the focal point (NOT doing pointless FOV correction). For
> now, does anyone know a more straightforward way?

I'm not sure if that could be helpful in this case but I remember small macros
I wrote in addition to standard screen.inc include file two years ago, where
you can reference points from 3D<->2D, see:

From: Włodzimierz ABX Skiba <abx### [at] babilonorg>
Newsgroups: povray.text.scene-files
Subject: screen.inc extension
Date: Fri, 12 Apr 2002 14:38:35 +0200

http://news.povray.org/61ldbu8kmln7dlhdr539tohffoiobi2k4s%404ax.com
http://news.povray.org/9bldbu02kv1nairhk1v6v25v1pivhssnjs%404ax.com

ABX


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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