Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How Does One Paint Isometry?

Name: Anonymous 2015-01-30 22:38

The usual drawing order is
1
2 3
4 5 6
7 8
9


But then tile 5 will overlap sprite moving between cells 2 and 3

And you can't draw underlying tiles before the sprites, otherwise large sprites would mess the higher level tiles. Typical tile cubes in games like X-Com and Magic & Mayhem are 32x32x16 (allows modelling nice curved terrain), while sprites are several times higher to maintain proportions

Name: Anonymous 2015-01-31 0:21

Name: Anonymous 2015-01-31 0:49

>>1
Just draw whatever is further away first. If the sprite is tall enough to block a higher level tile, draw the high tiles first. Otherwise, if the sprite is short and below the higher tiles, then draw the sprite first.

Name: Anonymous 2015-01-31 0:50

>>2

Z-sorting won't work, because zbuffer data is unavailable and tiles before the sprite lower Z, otherwise the sprite would occlude tiles floating in front of it.

Games like Diablo and X-com solve the problem by drawing floor tiles before the wall tiles. But my world format doesn't discern wall tiles from floor tiles, because 1-pixel high floor tiles look ugly.

Name: Anonymous 2015-01-31 1:18

>>3

That would s little complex to write and that much CPU power used for checks could be turned into larger world sample rates (i.e. 8x8x4 instead of 32x32x16).

Name: Anonymous 2015-01-31 2:18

To demonstrate the problem:
http://postimg.org/image/mo12r8fj3/

Name: Anonymous 2015-01-31 2:40

>>6
It is a funny one. Maybe you can just sort all drawn objects by distance to the camera. In isometricness, the camera is infinitely far away from the scene. Project coordinates onto the line parallel to the camera's direction. And use that number to determine drawing order. I think that would work.

Name: Anonymous 2015-01-31 2:45

>>7
sort all drawn objects by distance to the camera
that is the same painter algorithm, which "can fail in some cases, including cyclic overlap or piercing polygons."

Name: Anonymous 2015-01-31 2:50

>>8
But you don't have any polygons. Just sprites. It should work. It would work for voxels.

Name: Anonymous 2015-01-31 2:54

>>9

sprite is a poligon

Name: Anonymous 2015-01-31 2:59

>>10
sprites don't self intersect or cyclically overlap.

Name: Anonymous 2015-01-31 3:04

>>11
A group of sprites does.

The only simple solution for http://postimg.org/image/mo12r8fj3/ I see is cutting the leg off, they drawing it together with overlapping tile. I.e. a dummy object for the cutted leg, blitting part of sprite.

Name: Anonymous 2015-01-31 5:11

>>12
Painter's algorithm still works with the right ordering. Here is one.
http://postimg.org/image/c6671yx0r/

god fucking damn it, it took me at least an hour to post this.

Name: Anonymous 2015-01-31 8:00

>>13
You've totally failed. How do you determine drawing order of roof, so that 10 won't overlap some sprite standing on cube 6 or 7? And some sprite placed in a corner between 3 cubes would be overlapped by 7 cubes. Moreover, you haven't noticed that there are wall cubes behind the sprite - just above 4 and 5, but below roof cubes. What would be their drawing order? If we draw them after the sprite, they will overlap it.

Name: Anonymous 2015-01-31 8:21

>>14
You've totally failed.
Rude!

How do you determine drawing order of roof, so that 10 won't overlap some sprite standing on cube 6 or 7?
If there was a sprite there, it would have gone into the sort. Given two aligned rectangular prisms, you want to determine which could be in front of the other. Just take the coordinates of the bounding box and project onto the line parallel to the camera's direction. The camera is pointed in (1,1-1) or something like that? Normalize it if you want to, and just dot product that with coordinates and compare the values you get. It'll tell you the depth, up to a scalar if you don't normalize, which matter for getting the ordering. Do it to the coordinates of the vertices on the bounding boxes for the sprites.

The wall cubes are 7.5

You are being mean so I will not continue discussing this. Good day.

Name: Anonymous 2015-01-31 8:22

s/which matter/which don't matter

Name: Anonymous 2015-01-31 8:48

>>15
Rude!
Sorry ;_;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List