adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] Drawing order


From: Enrico Kochon
Subject: Re: [Adonthell-devel] Drawing order
Date: Mon, 27 Oct 2008 23:19:43 +0100

Does the bug in the screenshot result from the drawing order-stuff?
Well, I were a little bit to quick by saying how easy the solution was.
Ok, maybe it is not appropriate, I glimpse at the source and saw a nice
class structure with some cool classes like: renderer, sprite, surface,
surface_cacher and so on.
What I mentioned would involve a lot of changes at all places. The
framework seems to be 2D-only, thus it cant cope with a 3D-rendering
pipeline, where the Z-Buffer-Thingy is a natural part.
Sorry.

Regards, Enrico


Am Sonntag, den 26.10.2008, 20:49 +0100 schrieb Kai Sterker:
> On Sun, Oct 26, 2008 at 7:54 PM, Enrico Kochon
> <address@hidden> wrote:
> > Hi,
> >
> > why dont you just adjust the drawing order according to the viewpoint?
> > Beginning from the last to the first: this is the world-famous
> > "z-buffer" algo.
> 
> Which I only know by name ... might have to do some reading on it to
> see if it could be applied.
> 
> > However, I don't know much about the adonthell-rendering pipeline. So
> > maybe this is not appropriate.
> 
> Basically, there are simple 3D objects represented by a sprite. Since
> the objects are not supposed to intersect (in a properly constructed
> world), it ought to be possible to bring them into an order where
> their sprites can be drawn.
> 
> I have implemented yesterdays suggestion and it works up to a point.
> The major problem is that sometimes objects seem to have circular
> dependencies, so that each one overlaps at least one other object.
> That's where the algorithm fails and goes into an infinite loop. Maybe
> my checking routine is still a little off ... but it might also happen
> with a world where things intersect. Not the kind of code you'd want
> to have around.
> 
> If you are familiar with the z-buffer thing, maybe you'd want to have
> a look. The code in question is basically the mapview class, which
> collects the objects that should be visible at any given point,
> render_info which stores data about the objects for rendering and
> takes care of the sorting and finally renderer which does the actual
> drawing.
> 
> My latest changes (which I'm not sure if they are worth keeping)
> delegated the sorting into the renderer itself, but that is about the
> biggest difference.
> 
> Kai
> 
> 
> _______________________________________________
> Adonthell-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/adonthell-devel
> 

Attachment: screenshot.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]