Advertisement

Sprites clipping into each other

Started by May 30, 2000 11:43 PM
0 comments, last by David20321 24 years, 8 months ago
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

This topic is closed to new replies.

Advertisement