Re: [Algorithms] transforming a plane
Brought to you by:
vexxed72
From: Eric L. <le...@c4...> - 2000-09-07 06:21:33
|
> Is there a fast way to transform a plane? > > Right now I'm doing it by rotating the normal and tranforming > a point on the plane, then re-generating the 4d-vector form of > the plane. It seems there should be a way to do it with a > single 4x4 matrix multiply in some funny coordinate space. Yes, planes can be transformed with a single 4x4 matrix multiply. Planes transform contravariantly like normal vectors do, meaning that you need to transform it using the inverse transpose of the matrix that you would transform normal points with. Suppose you have a 4D column vector V representing a plane and a 4x4 transformation matrix M. Let V = <Nx, Ny, Nz, -d> where N is the plane's normal vector and d = (P dot N) for any point P on the plane. Then the transformed plane V' is given by V' = Transpose(Inverse(M)) * V -- Eric Lengyel |