Skip to main content
GameDev.net gamedev.net
🔒 Locked

User clip planes

Started by jeroenb Jan 25, 2006 at 4:19 AM 1 replies 1.5k views
Original Post
jeroenb
jeroenb
Say you have a quad, can one cut a corner out of it using two user clip planes? What I want to achief is that people can look into my geometry by cutting away a small part. What I tried was setting up the clip planes to { 1,0,0,0 } and { 0,1,0,0 } but what remains is only one small part instead of such a small part being cut away. Thanks for any help.
Crafter 2D: the open source 2D game framework ?Github: https://github.com/crafter2d/crafter2d
Twitter: [twitter]crafter_2d[/twitter]
bluntman
bluntman
The clip-planes in OpenGL will bi-sect your entire 3D space, cutting away 1/2 of it. If you want to cut away a section the only way I can think of is to apply a clip-plane, then draw your object, clear the depth-buffer, turn off the clip-plane, apply the other clip-plane and draw the object again.
Sounds like you need to reverse the direction of your clip-planes aswell.
jeroenb
jeroenb
Yes, perhaps I must do it that way. I also thought about a custom algorithm to clip the geometry against any number of plains, but that would make it hard for realtime plane movement .
Crafter 2D: the open source 2D game framework ?Github: https://github.com/crafter2d/crafter2d
Twitter: [twitter]crafter_2d[/twitter]

Topic Locked

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

Sign in to reply to this topic.