Newswire
Features
Connection
Job Search
Directories

by Brian Sharp
Gamasutra
April 25, 2000

This article originally appeared in the
February 2000 issue of:

Printer Friendly Version

Features

Implementing Subdivision Surface Theory

Listing 1. The Data Used to Represent the Control Net.

class ButterflySurface
{

public:
    ...

protected:
    ...

    // Information about the vertices
    int numVerts;
    int vertCapacity;
    float* verts;
    float* vertNorms;
    VertexEdges* vertEdges;
    float* texCoords;
    float* colors;

    // Information about the faces;
    // all faces are triangles.
    int numFaces;
    int faceCapacity;
    int* faces;
    int* faceEdges;

    // Connectivity information,
    // needed for tessellating.
    int numEdges;
    int edgeCapacity;
    ButterflyEdge* edges;
};

// Classes used in control net storage.
class VertexEdges
{
public:
    VertexEdges();
    VertexEdges(const VertexEdges& source);
    VertexEdges& operator=(const VertexEdges& source);
    int numEdges;
    int edges[MAX_VERTEX_VALENCE];
};

class ButterflyEdge
{
public:
    bool operator==(const ButterflyEdge& cmp) const;
    bool operator<(const ButterflyEdge& cmp) const;
    int v[2];
};

________________________________________________________

Back to Article

Home   JoinHelpContact UsShop
 


Home | Join | Help | Contact Us | Shop | Newswire | Site Map
Write for Us | Features | Connection | Job Search | Directories


Copyright © 1999-2000 Miller Freeman Inc. All rights reserved.
Privacy Policy

Miller Freeman Game Group: GDC, GDMag, IGF Independent Games Festival Game Developer Magazine Game Developers Conference