🎉 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!
Sprites clipping into each other
I got the sprites to draw themselves in reverse order, from the farthest to the nearest, and now they disappear when behind objects but when 2 sprites are very close together and I rotate the camera, as the rotate in the opposite direction they clip through each other and one of them ends up obscuring the other one because it''s drawn before the one in back of it.
This is how I find everything''s distance from the camera in case that helps at all. The squared represents multiplying the stuff before it by itself, it''s not an actual c command.
(Spritex-CamPosx)squared+(Spritez-CamPosz)squared+(Spritez-CamPosz)squared
All help is appreciated a lot.
By the way I''m kind of new at this, been using C for 4 days. Used to be using FutureBASIC 2.
Please turn on z-buffer which will decide visibility correctly regardless of the camera position.
If too close objects look funny (z-buffer problem), then you may be able to correct it by polygon offset: see p.250-253 of red book.
Tod
If too close objects look funny (z-buffer problem), then you may be able to correct it by polygon offset: see p.250-253 of red book.
Tod
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement