Trouble with transformations ...

Hello !

I wonder why I get different results with these 2 parts of code:

VECTOR4D v(0,0,1,1);

MATRIX4X4 m;
m = projMat * viewMat;
v = m * v;

glColor4f(1, 1, 0, 1);

glBegin(GL_POINTS);
    glVertex3fv(v);
glEnd();

and

VECTOR4D v(0,0,1,1);

glMultMatrixf(projMat);
glMultMatrixf(viewMat);

glColor4f(1, 1, 0, 1);

glBegin(GL_POINTS);
    glVertex3fv(v);
glEnd();

Shouldn’t the transformations be the same ?

[This message has been edited by fuxiulian (edited 12-13-2003).]

I have found the answer.

The problem was the w coordinate which I neglect during the rendering.

To solve that there are 2 methods:

[ul][li]use glVertex4f{v}[*]…or multiply x, y, z by 1/w[/ul][/li]
I have lost 1 day to figure this out. I thought I was going crazy…