Problem with clipping

Started by
2 comments, last by Squidi 22 years, 10 months ago
I''m working on an isometric game right now, and I''m having the worst time with clipping. Before I explain, please check out the following screenshot. Actually, in that shot I don''t think there is any need to clip, but anyway. If I clip by just drawing the guy when I draw the tile he is on, the tiles below him will draw over his feet. Then I try clipping based on height, but then tiles behind him, but higher up will be drawn over his head. I need help. I really don''t want to result to a z-buffer.
Advertisement
Let the point of the man that counts as being on a tile be a point at his feet, not the center of the man or whatever you are using now (if you have characters of differing sizes, then just store the "hotspot" with the image, similar to mouse cursor stuff)

Then render tiles from back to front and render the character just after the tile where his feet are. That way he should come in front of all tiles behind him (above him on screen) and none of the tiles below him should overdraw his feet, since they are within the tile you drew right before drawing the guy.

do I make sence?
or, perhaps that still causes overdraw, if the man is standing at a "southern" corner of a tile?

You could simply render all tiles from back to front and then render everything on the tiles from back to front...
a character or object that is drawn on an iso map has to be associated with the tile that is partially obscured by it that is drawn last.

Get off my lawn!

This topic is closed to new replies.

Advertisement