POV-Ray : Newsgroups : povray.off-topic : Viewing frustum question : Re: Viewing frustum question Server Time
4 Sep 2024 17:19:23 EDT (-0400)
  Re: Viewing frustum question  
From: Kevin Wampler
Date: 13 Feb 2010 15:57:59
Message: <4b771257@news.povray.org>
Warp wrote:
> clipka <ano### [at] anonymousorg> wrote:
>> Isn't such a transformation non-affine? So it wouldn't be possible to do 
>> it with a simple 4x4 matrix multiplication.

The trick which allows this is to use "homogeneous coordinates". 
Basically the 4th (or 3rd in you're in 2D) index in the coordinate 
vector is treated differently and is used to divide the other 
coordinates.  For example, let's say that the camera matrix maps a point 
(x,y,z,1) in 3D homogeneous coordinates to the point (u,v,w) in camera 
viewing coordinates.  The actual position on the "screen" given by this 
is then (u/w, v/w), where we've divided by the last coordinate.  It's 
this division which allows non-affine transformations to be represented.

Wikipedia has a nice article on homogeneous coordinates if you're 
interested in more:

http://en.wikipedia.org/wiki/Homogeneous_coordinates
http://en.wikipedia.org/wiki/Camera_matrix


>   Multiplication with a 4x4 matrix can be used for perspective projection.
> It's a 3x3 transformation matrix which is restricted to affine transformations.

3x4 is restricted to affine transformations.  A 3x3 matrix is restricted 
to linear transformations (assuming Cartesian instead of homogeneous 
coordinates).


Post a reply to this message

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