hello,

i'm doing a basic 3d modeler with a perspective view. i'd like to know

how i can adapt the perspective transformation matrix for normals, or if

it simply doesn't need to be adapted?

the formulas for perspective transformation are (when vertex are in the

eye space with the camera oriented along the x axis) :

xs = F * ((1 - D) / xe) / (F - D)

ys = D * ye / (h * xe)

zs = D * ze / (h * xe)

with D is the distance between the eye and the view plane, F is the

distance of the far clipping plane, and h the dimension of the view plane.

to transform into matrix form we separate like this :

xc = (h * F * xe) / (D * (F - D) - (h * F) / (F - D)

yc = ye

zc = ze

w = (h * xe) / D

and then xs = xc / w , ys = xc / w and zs = zc / w

this gives the matrix :

| (hF) / (D(F-D) 0 0 (-hF) / (F - D) |

| 0 1 0 0 |

| 0 0 1 0 |

| h/d 0 0 0 |

so the thing i'd like to know is how to obtain the equivalent matrix for

normals ?

i'v heard that it can be done by deleting the translations elements

(M30, M31 and M32), and then getting the transpose of the inverse of the

matrix M. but as i'm not sure of that i'd like different opinion.

Thanks,

--

Lucas

Montes