🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Some 3D clipping questions...

Started by
1 comment, last by Lutrosis 24 years, 5 months ago
My question seems to be a very rudimentary one, and yet I''ve never seen it explained before...ever. It deals with 3D clipping and some transformation. As I understand it, you cannot project a transformed vertice into screen coords if it''s Z value is less than(or greater than, depending on the coord system) 0. And this is for obvious reasons, when you look at the trig used to project them. My question is, how in the world to you do something as simple as a floor?? Here''s an example: Camera-> _______________ ^ floor Obvoiusly, some of the vertices of the "floor" polygon are going to have negative Z values. It''s obviously possible, since every first and apperantly third person game that uses polygons instead of raycasting does it. But how? Anybody know? I''m sure someone must. Mind helping out an obvious beginner? I''d certainly appreciate it... -Lutrosis
-Lutrosis#define WHOOPS 0class DogClass {public: CDog() { printf("Ruff!"); } Run() { printf("Run!"); } Crash() { printf("%d",100/WOOPS); }};DogClass CDog;CDog.Run();CDog.Crash();
Advertisement
The answer depends on the fact whether you clip the whole polygon (the floor) or just a part of it. You should clip just that part of the floor that is not visible due to the position of the camera.
The last truth is that there is no magic(Feist)
I think I see what you''re saying. Use an algo to create a new poly that goes to the extents of the clipping volume. I should be able to do that. Thanks.


-Lutrosis
"Christmas is nothing but an economic exchange with parents on the short end of the stick. Happy Holidays." - Me
-Lutrosis#define WHOOPS 0class DogClass {public: CDog() { printf("Ruff!"); } Run() { printf("Run!"); } Crash() { printf("%d",100/WOOPS); }};DogClass CDog;CDog.Run();CDog.Crash();

This topic is closed to new replies.

Advertisement