Data Structures For Computer Graphics
Data Structures For Computer Graphics
• General databases
The most popular data base models are relational, hierarchical, and network.
Hierarchical models are usually simple and fast, but only few relations in
the real world are purely hierarchical. The other disadvantages of
hierarchical structure are the hierarchical implementation usually creates
redundancy and a danger of inconsistency (i.e. cannot implement
non-manifold models)
record (PASCAL)
struct (C)
• Pointers
struct edge { struct point *pv1, *pv2; }
e1.pv1 = &v1;
e1.pv2 = &v2;
• Linked lists
In C, a vertex array of variable size n can be dynamically allocated as
vertex_header = (struct point*) calloc (n.sizeof(stuct point));
Single linked list has two fields: data and next link.
These unused memory cells would also be linked to form a linked list of
available nodes called AVAIL, which uses AVAIL as it list pointer variable.
Double linked list has three fields: data, previous link, and next link.
Figure 7.14 Linked lists describing faces of representation of the structure a polyhedral
object
• Recursion
E. g. Quadtree and octree data structures use of recursive methods in
computer graphics applications.
Figure 7.17 Recursive subdivision of a two-dimensional region
• Trees
Binary Tree - Each node of the tree has at most two children. Usually, binary
tree is used in CSG (Constructive Solid Geometry) representation. The nodes
in a binary tree are usually created by linked lists with pointers to its two
children.