Nodal geometry

From Organic Design wiki
Revision as of 05:49, 6 September 2006 by Rob (talk | contribs)

The conceptual structure of the initial interface is a 2D layer model, where layers are stacked in z-order and can exhibit transparency. Layers are arranged as a tree allowing each to be composed from a list of n child layers. The position and clipping area of a layer is governed by its parent.

The interface uses SDL's OpenGL context for final rendered output, but composes the root-child layers into surfaces and then transfers the surfaces to OpenGL textures. Later we'll allow any layer to be cached as a texture, rather than only the layers at the root level. This way processing load would be reduced by utilising the large unused resource of texture memory on the video card - usually around 256MB. These cached layer-composites are 32bit having alpha and are called sprites.

The root level layers are hooked in to the reduction loop permenantly and they in turn hook in various children based on redraw or collision queries or metrics updates which need to be resolved. These queries are guarunteed to be resolved by the end of the frame. These queries exhibit workflow and so are passed around amongst the nodes to be processed and passed on again until resolved.

Each layer receives a quanta and does the following set of operations which is considered reasonably atomic:

  • If absolute metrics are invalid, set from state of relative metrics
  • If sprite invalid, render background colour and or bg image
  • If collision query, calc and pass on if unresolved


Sprite
Sprites are runtime caches, device specific and represented non-nodally (as a spriteInfo struct in interface.c, or a symbol in interface.as)
  • in c
typedef struct {
    int index,x,y,w,h,t;
    double scale,rotation;
    Uint32 colour;
    } spriteInfo;
  • x,y,w,h (pixels)
  • scale
  • rotation
  • dynamic (if dynamic, sprite is root of new texture structure at runtime)
  • tile, next (maybe move these into container)


Container
Containers are device-independent nodal structures with no language-specific representation
  • x,y
  • w,h (min,cur,max)
  • units (%|px|mm...)
  • layout (U|D|L|R|none)
  • align (L|R|C|J) - relative to layout direction
  • wrap
  • clip
  • fill (colour, alpha)
  • sprite



Collision detection and redraw tree

Collision detection and the tree of redraw work use the recursion already inherent in the Nodal Reduction environment, but are essentially doing exactly the same process as the currently accepted ways, see Collision detection and Octrees.

See also: