bottom row of 4x4 matrix

Started by
16 comments, last by Grain 18 years, 9 months ago
What number are you referring to as the homogeneous(w) coord?

Mike C.
http://www.coolgroups.com/zoomer/

Quote:Original post by relsoft
By isometric transforms deffer means that your matrix should be normalized as well as having the 3 axes orthogonal to each other.

Calling gluPerspective would not make your homogeneous(w) coord negative. Why it does that to you, I have no idea.
gluPerspective does this (I think ;*))

1. Subtract view from pos to get the inverse forward vec
2. Cross Up and forward to get the right vector
3. Normalize all the vectors
4. Fill the transpose of the object matrix, thereby making a camera matrix
5. Translate with negative translation

So basically deffer is right in saying that the matrix should be isotropic and would not affect your bottom row.


Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Advertisement
The (1)

Last element.
Hi.
gluPerspective
You implied gluPerspective was making it negative. It's actually making it 0.

Mike C.
http://www.coolgroups.com/zoomer/

Quote:Original post by relsoft
The (1)

Last element.


Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
I don't have access to Google thanks to TMobile.

Anyway, here's the manual for gluPerspective:

NAME
gluPerspective - set up a perspective projection matrix


C SPECIFICATION
void gluPerspective( GLdouble fovy,
GLdouble aspect,
GLdouble zNear,
GLdouble zFar )

delim $$

PARAMETERS
fovy Specifies the field of view angle, in degrees, in
the y direction.

aspect Specifies the aspect ratio that determines the field
of view in the x direction. The aspect ratio is the
ratio of x (width) to y (height).

zNear Specifies the distance from the viewer to the near
clipping plane (always positive).

zFar Specifies the distance from the viewer to the far
clipping plane (always positive).


DESCRIPTION
gluPerspective specifies a viewing frustum into the world
coordinate system. In general, the aspect ratio in gluPer-
spective should match the aspect ratio of the associated
viewport. For example, $ "aspect" = 2.0 $ means the
viewer's angle of view is twice as wide in x as it is in y.
If the viewport is twice as wide as it is tall, it displays
the image without distortion.

The matrix generated by gluPerspective is multipled by the
current matrix, just as if glMultMatrix were called with the
generated matrix. To load the perspective matrix onto the
current matrix stack instead, precede the call to gluPer-
spective with a call to glLoadIdentity.

Is there something in there you wanted me to see?

Mike C.
http://www.coolgroups.com/zoomer

Quote:Original post by deffer
gluPerspective


Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Quote:Original post by mike74
1 0 0 0
0 1 0 0
0 0 -1.002002 -0.200200
0 0 -1 0

Should gluPerspective be doing this weirdness to my matrix?


(slightly modified) from http://pyopengl.sourceforge.net/documentation/manual/gluPerspective.3G.html (second link here)
zf -> zFarzn -> zNearas -> aspect(f/as)     0          0               0   0       f          0               0   0       0   (zf+zn)/(zn-zf) (2*zf*zn)/(zn-zf)   0       0          -1              0
Quote:Original post by relsoft
By isometric transforms deffer means that your matrix should be normalized as well as having the 3 axes orthogonal to each other.

Calling gluPerspective would not make your homogeneous(w) coord negative. Why it does that to you, I have no idea.
gluPerspective does this (I think ;*))

1. Subtract view from pos to get the inverse forward vec
2. Cross Up and forward to get the right vector
3. Normalize all the vectors
4. Fill the transpose of the object matrix, thereby making a camera matrix
5. Translate with negative translation

So basically deffer is right in saying that the matrix should be isotropic and would not affect your bottom row.



What was I thinking?!! This is gluLookAt.

major booboo. Sorry guys. :*)

Hi.
Quote:Original post by mike74
Could someone please tell me when the bottom row of a 4x4 matrix will not equal:

0 0 0 1

I may be mistaken but doesn’t OpenGL use the right most column for that?

[Edited by - Grain on July 13, 2005 4:10:38 AM]

This topic is closed to new replies.

Advertisement