Newswire
Features
Connection
Job Search
Directories

by Aaron Lee
Gamasutra
September 8, 2000

Printer Friendly Version
   
Discuss this Article

Features

Building Your Own Subdivision Surfaces

Listing 1. Locating White Triangle

Edge PointLocation( V, M ) {

    e = randomEdge( M );
    if RightOf( V, e )
        e = e.Sym; /* e.Sym is the reverse of e */
    while (1) {
        if (V == e.v1 || V == e.v2 )
            return e;
        else
            whichop = 0;
            if !RightOf(V, e.Onext)
                whichop += 1;
            if !RightOf(V, e.Dprev)
                whichop += 2;
            switch (whichop) {
            case 0:
                return e;
                break;
            case 1:
                e = e.Onext;
                break;
            case 2:
                e = e.Dprev;
                break;
            case 3:
                if (dist(e.Onext, V) < dist(e.Dprev, V))
                    e = e.Onext;
                else
                    e = e.Dprev;
                break;
            };
    };
};

________________________________________________________

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