Archived

This topic is now archived and is closed to further replies.

Squidi

Problem with clipping

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites