> From: "Chad Zalkin" <[EMAIL PROTECTED]>
> 
> Is there an algorithm out there to create a rectangle with another one cut
> out of it?


Yup, see com.sun.j3d.utils.geometry.Triangulator.  Create a GeometryInfo with a 
polygon array with two bounds (the recrangle and the hole) and then pass it to 
the triangluator, which will produce triangles.

For a simple case like a rectangle inside a rectangle, you can hard code the 
solution.  Just be sure that all your triangles (or quads) are oriented so that 
the points form counter-clockwise loops:

        
        A----------D
        |\        /|
        | \      / |
        |  E----H  |
        |  |    |  |
        |  F----G  |
        | /      \ |
        |/        \|
        B----------C
        

The resulting quads should be ABFE, BCGF, CDHG, DAEH.

Doug Gehringer
Sun Microsystems

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to