COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### isometric on OpenGL

• Follow

```How do you ensure you draw an isometric game like Age of Empires with stuff overlapping other stuff properly?

Do you typically use a depth buffer?

```
 0
Reply bob3904 (239) 5/30/2012 12:41:43 AM

```On Wednesday, May 30, 2012 2:41:43 AM UTC+2, b...@coolfone.comze.com wrote:
> How do you ensure you draw an isometric game like Age of Empires with stuff overlapping other stuff properly?
>
> Do you typically use a depth buffer?

Yes

```
 0
Reply tooby (65) 5/30/2012 7:41:25 AM

```On Tue, 29 May 2012 17:41:43 -0700, bob wrote:

> How do you ensure you draw an isometric game like Age of Empires with
> stuff overlapping other stuff properly?
>
> Do you typically use a depth buffer?

Such games pre-date 3D-capable hardware, and typically used the painter's
algorithm, i.e. draw from back to front.

Typically, you would have several layers, drawn starting with the ground
layer and moving upwards. Each layer would be drawn from back (top of
screen) to front (bottom of screen).

More generally, any two non-intersecting, convex objects can be separated
by at least one plane. If the objects' projections overlap, the object
which is on the opposite side of the plane to the viewpoint will
appear behind the object which is on the same side, and thus should be
drawn first.

This gives you a partial ordering over objects. A topological sort will
provide a total ordering if one exists (i.e. if there are no cycles in the
graph).

```
 0
Reply nobody (4805) 5/30/2012 1:46:33 PM

```Nobody wrote:

> Such games pre-date 3D-capable hardware, and typically used the painter's
> algorithm, i.e. draw from back to front.
>
> Typically, you would have several layers, drawn starting with the ground
> layer and moving upwards. Each layer would be drawn from back (top of
> screen) to front (bottom of screen).
>
> More generally, any two non-intersecting, convex objects can be separated
> by at least one plane. If the objects' projections overlap, the object
> which is on the opposite side of the plane to the viewpoint will
> appear behind the object which is on the same side, and thus should be
> drawn first.
>
> This gives you a partial ordering over objects. A topological sort will
> provide a total ordering if one exists (i.e. if there are no cycles in the
> graph).

Nowadays the same effect can be had by rendering a standard 3D scene, but
with an orthographic projection and with the camera placed at a 45 degree
angle with the horizontal plane.

Rui Maciel
```
 0
Reply rui.maciel (1746) 5/30/2012 1:51:13 PM

```On Wednesday, May 30, 2012 3:46:33 PM UTC+2, Nobody wrote:
> On Tue, 29 May 2012 17:41:43 -0700, bob wrote:
>
> > How do you ensure you draw an isometric game like Age of Empires with
> > stuff overlapping other stuff properly?
> >
> > Do you typically use a depth buffer?
>
> Such games pre-date 3D-capable hardware, and typically used the painter's
> algorithm, i.e. draw from back to front.
>

The later versions are fully 3D (starting
with AOE III I think).

Depth buffer is free so there's no
point in not using it these days, even
for sprites.

```
 0
Reply tooby (65) 5/30/2012 3:27:58 PM

```On 5/30/2012 10:27 AM, fungus wrote:
> On Wednesday, May 30, 2012 3:46:33 PM UTC+2, Nobody wrote:
>> On Tue, 29 May 2012 17:41:43 -0700, bob wrote:
>>
>>> How do you ensure you draw an isometric game like Age of Empires with
>>> stuff overlapping other stuff properly?
>>>
>>> Do you typically use a depth buffer?
>>
>> Such games pre-date 3D-capable hardware, and typically used the painter's
>> algorithm, i.e. draw from back to front.
>>
>
> The later versions are fully 3D (starting
> with AOE III I think).
>
> Depth buffer is free so there's no
> point in not using it these days, even
> for sprites.
>

well, sometimes a person might not use the depth buffer, but anymore
this would be more for sake of certain kinds of special effects (and
even then, it is typically by disabling depth writes, rather than depth
checking).

likewise, a person might draw from back to front, but at this point,
this would be more likely be for sake of getting reasonable behavior
from alpha-blending and shader effects and similar (and isn't really
needed for opaque geometry, which can be in-fact faster if drawn
front-to-back).

since, yes, the depth buffer is pretty much free.

```
 0
Reply cr88192355 (1754) 6/1/2012 5:03:38 AM

5 Replies
101 Views