On Mon, May 26, 2008 at 11:48 PM, Kai Sterker <[EMAIL PROTECTED]> wrote:

> So now I can fully concentrate on fixing up the renderer. Then all the
> other stuff listed above. Then the editor. Looks like a busy schedule,
> if I want to make it until September ...

First part is done. After going back to the drawing board I finally
came up with the correct formula to determine whether an object in our
octree is in the view or not. In our special case, it takes just the
following 3 lines:

    if (max_x < min.x() || min_x > max.x()) return false;
    if (max_yz < (min.y() - max.z()) || min_yz > (max.y() - min.z()))
return false;
    return true;

min_x,max_x,min_yz and max_yz are the corners of the map view.
min and max are the corners of the object (or chunk) bounding box.

Line one should be self-explanatory. We check for an overlap on the x-axis.
Line two is basically a projection of the remaining two dimensions
onto one and a check for overlap with the map view at a given height.

It's all in CVS and you can fire up worldtest to see stuff in action.


What's left to do now is the drawing order. It's nearly right, but not
quite. Hope figuring that one out doesn't take as long as the above!

Kai


_______________________________________________
Adonthell-devel mailing list
Adonthell-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/adonthell-devel

Reply via email to