l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
July 21: Defensive computing: Information security for individuals
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2005 Jan 15 08:49

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] OpenGL - perspective projections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] OpenGL - perspective projections



On Fri, 14 Jan 2005 11:15:19 -0500
p@dirac.org (Peter Jay Salzman) wrote:

> Hi all,
> 
> In my little snatches of spare time, I've been reading a book on
> OpenGL. Don't care much for the book, but that's the breaks.
> 
> I have a question about the projection matrix.
> 
> When I draw stuff to the screen, OpenGL takes care of perspective for
> me. In other words, when I put a triangle centered at (0,0,-1), it
> apears bigger than a triangle centered at (0,0,-999999).  I don't have
> to play with a projection matrix for this to happen.
> 
> So, then, what exactly is the projection matrix used for?

There are many different options for how to project an image.

One reason you might change the projection matrix is if you wanted an
orthographic projection, where a triangle centered at (0,0,1) was the
same size as a triangle centered at (0,0,-999999)

Another reason is if you wanted to change the field of vision either by
changing its angle, its aspect ratio (which you probably want to keep
synchronized with the window), or changing the near or far clipping
distance. I'm surprised that you see a triangle centered at
(0,0,-999999) - I would expect the default clipping matrtix to
either clip off a triangle place that far back, or that triangle should
be so small that you don't even see it. Try placing triangles at
centered at (0,0,.5) (0,0,0) and (0,0,-.5), and see whether you're using
using an orthogonal matrix or a perspective matrix.

I suspect your default projection matrix should be the identity matrix -
an orthographic projection matrix that clips anything with a coordinate
greater than 1 or less than -1.

(Of course, if you haven't turned on depth buffering then it won't clip
anything at all based on depth.)

--Ken Bloom

-- 
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.

Attachment: pgp00014.pgp
Description: PGP signature

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.