Skip to main content
gamedev.net
🔒 Locked

clipping planes

Started by fosh Apr 4, 2005 at 8:42 PM 1 replies 800+ views
Original Post
fosh
fosh
So ive been messing with clipping planes lately (ogl) but have found they dont really do what i expect...i have a feeling this has to do with my lack of understanding of the correct way to specify the planes. given ax+by+cz+d < 0, to create a plane that clips everything with y value greater than or equal to 0, you'd use = <0,1,0,0> right? so y < 0, and there is no restriction placed upon x or z. This isnt the behaviour im getting tho, if you divide the screen into 2 triangles - top left, and bottom right, it is cutting off everything in the bottom right. I assume this is because i am using gluLookAt to position the world correctly and the clipping plane i specify is not being transformed through the new modelview matrix it creates? If this is the case, what is the usual approach of transforming the clipping plane values to produce the correct result? Should i use glMultMatrix with the clipping plane values after specifyign the initial transformation , and then extract the results and use those ? cheers, Scott
zedzeek
zedzeek
Quote:
given ax+by+cz+d < 0, to create a plane that clips everything with y value greater than or equal to 0, you'd use
= <0,1,0,0> right? so y < 0
yeah eiher that of 0,-1,0,0 (i forget if it clips or keeps)
anyways it operates relative to the current origin (whatever that is), try using glLoadIdentity(); to reset the origin to 0,0,0
fosh
fosh
current origin you say?>
then its brokenness has nothing to do with gluLookAt
:(

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.