13,150,867 members (39,964 online)
alternative version

#### Stats

177.9K views
23 bookmarked
Posted 6 Feb 2002

# Tesselation of Mono Connected Non Convex Polygon

, 6 Feb 2002
 Rate this:
Tesselation of mono connected non convex polygon

## Introduction

A simple alternative to OpenGL polygon tesselation callback. You can focus on file triangle.h that contain the class to evaluate convexity of polygon and tesselate the polygon. No extra points are inserted. You can work only with planar polygon also in 3D.

Every suggestion in order to speed up the class and create better tesselation ('better' triangles) is appreciated.

## History

• 6th February, 2002: Initial post

## Share

 United States
No Biography provided

## You may also be interested in...

 View All Threads First Prev Next
 Problem in CPolyTri::ComputeNormal Torsten B8-Jun-04 1:43 Torsten B 8-Jun-04 1:43
 Re: Problem in CPolyTri::ComputeNormal Sebastien Maraux13-Dec-04 3:52 Sebastien Maraux 13-Dec-04 3:52
 It could be better for performance issue to exclude the case of last j from the for loop, in order not to compute the modulo each time. I would do : normal[0]=normal[1]=normal[2]=0.0f; for( register int i=0 , j=1 ; j < nPoints ; i++ , j++ ){ normal[0]+= ( points[i][1] - points[j][1] ) * ( points[i][2] + points[j][2] ) ; normal[1]+= ( points[i][2] - points[j][2] ) * ( points[i][0] + points[j][0] ) ; normal[2]+= ( points[i][0] - points[j][0] ) * ( points[i][1] + points[j][1] ) ; } // last case : normal[0]+= ( points[i][1] - points[0][1] ) * ( points[i][2] + points[0][2] ) ; normal[1]+= ( points[i][2] - points[0][2] ) * ( points[i][0] + points[0][0] ) ; normal[2]+= ( points[i][0] - points[0][0] ) * ( points[i][1] + points[0][1] ) ; -------------------------------------------------- It would also be a good idea to delete Vector3F array in CPolyTryView::OnDraw(CDC* pDC) after call to triangulate() to avoid memory leaks !
 Re: Problem in CPolyTri::ComputeNormal Sébastien Maraux13-Dec-04 23:45 Sébastien Maraux 13-Dec-04 23:45
 Last Visit: 31-Dec-99 18:00     Last Update: 25-Sep-17 22:05 Refresh 1