POV-Ray : Newsgroups : povray.advanced-users : About types of projections Server Time
2 Nov 2024 11:23:13 EDT (-0400)
  About types of projections (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Pavel Rumyantsev
Subject: About types of projections
Date: 6 Dec 1999 04:23:21
Message: <384B8080.D4327C25@mv.ru>
Hi!

I use POV-Ray approximately 1,5 years and I can't undestand the types of

projections. Of course, I can understand perspective projection and, may

be, ortographic projection. Could anybody explain me another types of
projections? I'd like TO FEEL them, do you understand me?

Thank you.

Pavel Rumyantsev



Post a reply to this message

From: Margus Ramst
Subject: Re: About types of projections
Date: 6 Dec 1999 13:04:29
Message: <384BFB3B.E3C15390@peak.edu.ee>
Well. You asked for it, you are gonna get it...

I will not delve into the principles and problems of mapping a 3D topography
onto a 2D surface. For this, I suggest you see one of the many web pages dealing
with map projections.
In the text I mention 'model space' and 'screen space'. By 'model space' I mean
the virtual 3D space of the scene, and by 'screen space' I mean the 2D surface
(e.g. your monitor) onto which this scene is rendered.

-------------------------------------------

The basic differences between the cameras are:
a) is the view point fixed or not, if not how does it move;
b) in what directions are the rays shot (in relation to the viewpoint);
c) to what topography are the resultant samples mapped (in 3D model space and in
2D screen space).
Once you know these parameters of a particular projection, it just takes a bit
of visualisation to predict the resulting image.

-------------------------------------------

The basic perspective camera and orthographic camera use simple planar
projection. Planar projections have the property of keeping straight lines in
the scene straight also in the image. However, in all cases but orthographic,
planar projections distort distances. The distortion increases towards the edges
of the image.

Orthographic projection is pretty straight-forward: all view rays are parallel
and equally spaced, so there is no perspective, and no distortion of distances.

The standard perspective camera traces rays from a fixed viewpoint, mapping
samples to a rectangle. Because the horisontal and vertical angle between camera
rays remains constant, they do not hit the rectangle at constant intervals.
Instead, they are positioned more sparsely towards the edges of the rectangle.
This is what causes the distortion of distances (stretching) I mentioned
earlier.

-------------------------------------------

The fisheye, ultra_wide_angle and omnimax projections are types of spherical
projection, i.e. the samples are mapped to a sphere. Spherical projections can
avoid distortion of distances, but they cannot keep straight lines in the scene
straight in the rendered image.

The fisheye projection maps the image to a sphere (or a section thereof) in
model space and to a circle in screen space. The direction in which the camera
looks is at the center of the image. You can then imagine the consecutive rays
being rotated more and more towards the opposite pole of the sphere. The
outermost rays form the fringe of the circle. If the camera has a 360 degree
angle, all outermost rays point towards the opposite pole and all pixels at the
fringe of the circle represent the same point.
NB! The render of a 360 degree fisheye camera _cannot_ be used as an
image map for spherical mapping (map_type 1). The fisheye camera maps the scene
with polar coordinates, whereas map_type 1 needs an image with rectangular
coordinates. Polar to rectangular conversion of a bitmap is possible, but lossy.
There exists an unofficial version of POV has a spherical camera which yields an
image with rectangular coordinates. Hopefully this will also make it into
official POV.

The ultra_wide_angle projection is a bit unfamiliar to me, but here's a guess.
It works the same way as fisheye in model space - but in screen space, a section
of the sphere is orthographically mapped to a rectangle.

The omnimax projection is just a specialized type of fisheye. The screen output
is somewhat elliptical, as you can see yourself. In model space, the samples are
probably projected to a sphere that has been flattened along the up vector.

-------------------------------------------

The panoramic and the various cylinder cameras use cylindrical projection. In
model space, they are mapped to a cylinder; in screen space, to a rectangle. In
terms of distortion, they share common properties with both spherical and planar
projections.

Cylinder 1&2 projections are pretty easy to visualize. The viewpoint is fixed at
the center of the cylinder. Along the axis of the cylinder (i.e. up or sideways,
respectively), they have the properties of standard perspective projection
(fixed viewpoint planar projection): lines parallel to the axis, that are
straight in 3D, stay straight in the rendered image; features are stretched
along the axis as they near the edge of the image. Along the perpendicular
direction (sideways or up, respectively) they have the same properties as
spherical projection: no stretching towards the edges, but lines that are
straight in the scene do not stay straight in the rendered image.

Panoramic projection is rather similar to cylinder 1 projection. In cylinder 1,
vertical angle of the rays changes constantly, but consequently the rays do not
hit the cylinder at constant vertical intevals. This is what causes stretching
at the image edges in both cylindrical 1&2 and perspective projection. Panoramic
projection tries to counter this by varying the amount by which the vertical
angle of rays changes from row to row. This allows the samples to be spaced in
an uniform grid (i.e. in an equirectangular configuration) over the entire
cylinder, thus reducing distortion of distances.

Cylinder 3&4 projections are quite simple. The viewpoint is fixed at the axis of
the cylinder, but moves down as the render progresses. Thus the projection is
orthographic along the axis of the cylinder - there is no perspective along the
axis, far objects do not seem smaller. Along the perpendicular direction it
again acts like spherical projection - there is perspective, but straight lines
do not stay straight. Because in one direction there is perspective and along
the other there isn't, objects - esp. distant objects - seem stretched along the
orthographic direction. Objects that cross the view diagonally look especially
weird, since they appear both bent and stretched in the image.

-------------------------------------------

I hope this <ahem> brief tutorial proves helpful. If not, ask and I will try to
explain in a more intelligible manner.

Margus


Post a reply to this message

From: David Wilkinson
Subject: Re: About types of projections
Date: 6 Dec 1999 13:57:14
Message: <sAZMOLpmt5A5=SWobWmwtzoUccaa@4ax.com>
On Mon, 06 Dec 1999 20:06:51 +0200, Margus Ramst <mar### [at] peakeduee> wrote:

>Well. You asked for it, you are gonna get it...
>
snip

>I hope this <ahem> brief tutorial proves helpful. If not, ask and I will try to
>explain in a more intelligible manner.
>
>Margus

Very educational Margus.  Thanks
------------
dav### [at] cwcomnet
http://www.hamiltonite.mcmail.com
------------


Post a reply to this message

From: Pavel Rumyantsev
Subject: Re: About types of projections
Date: 7 Dec 1999 00:18:20
Message: <384C9891.A183DE05@mv.ru>
Margus!

MANY thanks for your explanation. It's very informative. Seems, I'm getting
understood the types of projections. Really!

Good luck for you!

Pavel Rumyantsev


Post a reply to this message

From: Rune
Subject: Re: About types of projections
Date: 11 Dec 1999 22:48:02
Message: <38531af2@news.povray.org>
Margus Ramst wrote:
>The standard perspective camera traces rays from a fixed viewpoint, mapping
>samples to a rectangle. Because the horisontal and vertical angle between
camera
>rays remains constant, they do not hit the rectangle at constant intervals.
>Instead, they are positioned more sparsely towards the edges of the
rectangle.
>This is what causes the distortion of distances (stretching) I mentioned
>earlier.

I think it's the other way around.
The rays *does* hit the rectangle at constant intervals, the horisontal and
vertical angle between camera rays *doesn't* remains constant. *That* is
what causes the distortion of distances.
An example: When the camera is perpendicular to a plane with a checker
pattern, the checker pattern is NOT distorted.

But if you imagined a *sphere* around the camera, *then* the rays would be
positioned more sparsely towards the sides.

Well, at least I think so :-)

Greetings,

Rune

---
Updated December 10: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!


Post a reply to this message

From: Peter Popov
Subject: Re: About types of projections
Date: 12 Dec 1999 00:29:49
Message: <ki9TOIookU9H0cOGa0LmV9nkopR+@4ax.com>
On Sun, 12 Dec 1999 04:48:09 +0100, "Rune" <run### [at] inamecom>
wrote:

>I think it's the other way around.
>The rays *does* hit the rectangle at constant intervals, the horisontal and
>vertical angle between camera rays *doesn't* remains constant. *That* is
>what causes the distortion of distances.

Any projection leading to decreasing the number of dimensions leads to
some kind of distortion. Our eyes distort the image, too, but the
projection is not on a planar surface rather a part of a sphere. Our
brain corrects this and we do not notice it, but other kinds of
distortion are quite obvious to the eye.

>An example: When the camera is perpendicular to a plane with a checker
>pattern, the checker pattern is NOT distorted.

*Only* in the central pixel of the image <grin>. Try rendering the
same but bring the camera very close to the checkered plane and
increase the angle to something very big, say 160. See for yourself :)

>But if you imagined a *sphere* around the camera, *then* the rays would be
>positioned more sparsely towards the sides.

With the spherical projection no distortion would occur provided the
screen was spherical. Some old monitors which are quite bulgy can give
great results at 3D provided that you can guess the curvature and then
convert it to POV units.


Peter Popov
pet### [at] usanet
ICQ: 15002700


Post a reply to this message

From: Margus Ramst
Subject: Re: About types of projections
Date: 12 Dec 1999 13:26:06
Message: <3853E949.B0AC11A5@peak.edu.ee>
The only way the checker pattern isn't distorted is with the orthographic
camera. The distortion of the perspective camera becomes obvious at high camera
angles (this is why the panoramic camera was added). At angles -> zero the
distortion of the perspective camera is indeed negligible, since it starts to
look like orthographic projection (rays are nearly parallel). But try an angle
of, say, 150 and you know what I mean.
Believe me, at least in the principles of planar and spherical projection I was
not mistaken.

Margus

Rune wrote:
> 
> I think it's the other way around.
> The rays *does* hit the rectangle at constant intervals, the horisontal and
> vertical angle between camera rays *doesn't* remains constant. *That* is
> what causes the distortion of distances.
> An example: When the camera is perpendicular to a plane with a checker
> pattern, the checker pattern is NOT distorted.
> 
> But if you imagined a *sphere* around the camera, *then* the rays would be
> positioned more sparsely towards the sides.
> 
> Well, at least I think so :-)
>


Post a reply to this message

From: ingo
Subject: Re: About types of projections
Date: 12 Dec 1999 14:51:44
Message: <8E9AD61BDseed7@204.213.191.228>
Margus Ramst wrote:

>The only way the checker pattern isn't distorted is with the orthographic
>camera. The distortion of the perspective camera becomes obvious at high
>camera angles (this is why the panoramic camera was added). At angles ->
>zero the distortion of the perspective camera is indeed negligible, since
>it starts to look like orthographic projection (rays are nearly parallel).
>But try an angle of, say, 150 and you know what I mean.

I know what you mean, but what you say / do is wrong /something different.

the second thing you do is pull back the camera to keep the object at the 
same scale. The object camera distance is what determines the perspective. 
Not the camera angle.

Try the following:
put a box at origin, rotate 45*y.
Set up your camera at a position on the -z-axis you like and keep the camera 



image again but with such a bigger +w and +h that the box has the same hight, 
in pixels, as in your first image.
Cut out the boxes of both images and compare. You will see that there is no 
difference in perspective (distorion)

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Margus Ramst
Subject: Re: About types of projections
Date: 12 Dec 1999 18:22:46
Message: <38542ED2.2C90FE79@peak.edu.ee>
The thing that determines distortion is proximity to the image edge. Of course,
if you increase the angle to 150 degrees, the box becomes smaller in the image,
so all samples of the box are closer to the image center. This cancels out the
distortion. If the box would be at the image edge with both camera angles, there
would be a definite difference.
What I'm saying is that the distortion towards the image edges increases as the
camera angle increases. This is not perspective distortion, it is a specific
distortion of dimensions inherent to this type of mapping.

Margus

ingo wrote:
> 
> Try the following:
> put a box at origin, rotate 45*y.
> Set up your camera at a position on the -z-axis you like and keep the camera

> 

> image again but with such a bigger +w and +h that the box has the same hight,
> in pixels, as in your first image.
> Cut out the boxes of both images and compare. You will see that there is no
> difference in perspective (distorion)
> 
> Ingo
> 
> --
> Photography: http://members.home.nl/ingoogni/
> Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Rune
Subject: Re: About types of projections
Date: 14 Dec 1999 17:01:17
Message: <3856be2d@news.povray.org>
Margus Ramst wrote:
>The only way the checker pattern isn't distorted is with the orthographic
>camera. The distortion of the perspective camera becomes obvious at high
camera
>angles (this is why the panoramic camera was added). At angles -> zero the
>distortion of the perspective camera is indeed negligible, since it starts
to
>look like orthographic projection (rays are nearly parallel). But try an
angle
>of, say, 150 and you know what I mean.
>Believe me, at least in the principles of planar and spherical projection I
was
>not mistaken.

What I meant when I said the checker pattern wouldn't become distorted, was
that each square of the checker pattern would be the same size and shape in
the output image. That might have been uncorrect wording but anyway, that's
what I meant :-)

I still insists that the rays *does* hit a plane perpendicular to the camera
viewing direction at *constant* *intervals*, and thus, the horisontal and
vertical angle between the camera rays *doesn't* remains constant.
However I said that the rays would be positioned more sparsely towards the
sides. That, of course, is wrong. The rays are positioned more sparsely
towards the *middle*.

Greetings,

Rune

---
Updated December 10: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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