View Full Version : Transforming planes in2 homogenouse coordonates

Can someone help me transform a plane from world space in2 projection space. I want to transform a know plane defined by its normal and a distance in world space in2 projection space. I know the composite world to projection space matrix. How can I apply the matrix on the plane ?

Tom Nuydens

11-03-2003, 12:43 AM

http://www.cs.unc.edu/~hoff/techrep/xformplane.html

-- Tom

Can someone help me transform a plane from world space into projection space. I want to transform a know plane defined by its normal and a distance in world space in2 projection space. I know the composite world to projection space matrix. How can I apply the matrix on the plane ?

I am not entirely sure what it is that you ultimately want to do. The projection of a 3D plane into the image plane will give you either the image plane or a line in the case when the world plane passes through the optical centre, so to my mind the only question you need to consider (if this is what you want to do) is whether your 3D plane degenrates into a line. You can do that by testing if the point [0, 0, 0, 1] satisfies the equation of the plane in eye coordinates (or, equivilentlym computing the optical centre in world coordinates and testing that point against the plane in world coordinates). If the test succeeds then you could project the plane's normal and see the gradient of the plane's image.

I don't think that's what you really want to do, since it doesn't seem all that useful. Perhaps you could explain your problem in more detail? Are you concerned with a subset of the plane? Maybe how a triangle moves in projection space?

cheers,

John

[This message has been edited by john (edited 11-03-2003).]

I'm trying to implement clipping planes in pixel shader with texkill and since i'm allready transforming the position from object space into projection space I was thincking that I could just do a dp4 with a plane that is transformed in2 projection space and passed it to texkill.

Tom Nuydens 10q very much i've test it and it's working. Actualy I'm getting the same distance as in world space. Really cool.

Another question for you guys is really the distance from a transformed point into the projection space lets call him P (x,y,z,w) to the right plane of frustum actualy x-w ? That's strange since the right frustum plane equation from world space transformed into projection space give something that will never result that formula. But still the formula work. I've did clipping based on that formula. For a given edge a-b that intersect the right frustum plane the interpolation ratio for clipping is actualy (xb-wb) / ((xb-wb) - (xa-wa)) where a is inside the frustum and b is out side (xb > wb and xa < wa). What is the mathematic explication for that ?

Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.