From: Ilmari Heikkinen Date: 2005-06-03T15:26:20+09:00 Subject: Re: [ANN] librend 0.0.1 pe, 2005-06-03 kello 01:33, Joel VanderWerf kirjoitti: > Ilmari Heikkinen wrote: > > > > On 2.6.2005, at 21:03, Joel VanderWerf wrote: > ... > >> Do you think this will ever be a replacement for the Tk 2D canvas? I'm > >> thinking of things like layers, groups, event bindings, etc. > > > Do you have some specific thing in mind regarding the layers, what > > should they do? > > For example: a "car" is composed of several 2D shapes plus some text > that floats alongside it. The shapes are all at the same level (above > the roadway, let say), but the text is at a higher level. So if two cars > pass near each other, the text is not obscured. I've sometimes emulated > that in OpenGL by using very small z-axis values, but it seems like a > hack to use 3D drawing at all in this case. Yes, actually there are a couple of ways to achieve this. In the vector scenes the elements are ordered by z-index to build a drawing list. But there are is no layer abstraction. Hmm, maybe it could be done by normalizing the z-indices inside a layer to [0,1) and then adding the layer index to that. Or, better yet, draw each layer on its own surface and blend them together in the end. There are also renderer "layers"; the renderer draws Views, which have a viewlist. The viewlist is composed of [camera, scene, effects]-tuples, which the renderer draws in order, clearing the depth buffer between them. So it's possible to draw a perspective-projected scene first, followed by e.g. name markers, and then an ortho-projected HUD on top.