Hello,

I had some problems with long-small triangles using some triangulation
routine as well. I got some good ideas from the paper "Efficient
Triangulation of Simple Polygons" (Godfried Toussaint, McGill
University) which should be somewhere on the web. The idea is that you
take any vertex, find another one which is 'visible' from that vertex
and split the polygon into two along that line (and repeat the splitting
on both polygons etc.). A good way of obtaining better quality
triangulations is to first find all the visible vertices and then choose
that one which best bisects the angle between the edges at your starting
vertex.
This is just something I hacked together (and not in Java unfortunately)
and I am sure there are much better routines out there.

Regards,

Mattijs

White Morph wrote:
Hi,

I have 2 polygons each has 7 points, they share 3 points, so the total
unique points are 11. I tried 2 ways to render the 2 polygons.

1. Manually triangulate the 2 polygons, send the array of triangles to
   GeometryInfo class to calculate normals and render the shape. The result
   shape is shading smoothly across the 2 polygons, no obvious edge between
   the 2 polygons.

   The printing result shows there are 11 unique points and 11 normals,
   so each point just has one normal.


2. Send each polygon to a GeometryInfo class to do triangluation. Get
   the triangles from each GeometryInfo class and send them together to a
   third GeometryInfo class to calculate normals and then render the shape.
   The 2 ploygons are separted by an obvious edge.

   The printing result shows there are 11 unique points and 16 normals, so
   some shared points have more than 1 normal.


The triangulation did by GeometryInfo generates some long-small triangles.
In my case, they generate a triangle using the 3 shared points for each
polygon but with opposite direction, so the 2 triangles differ 180 degree.
That causes the problem.

I am wondering what the triangluation algorithm that Java3D uses, can it
be optimized to generate more elegant meshes???

Thank you for your comments and suggestion----white.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

.



--
/*---------------------------------------------------------*\
| ===========           Mattijs Janssens                    |
| \\        /           Development Engineer                |
|  \\      /                                                |
|   \\    /             Nabla Ltd.                          |
|    \\  /              The Mews, Picketts Lodge            |
|     \\/               Picketts Lane, Salfords,            |
|     F ield            Surrey RH1 5RG.                     |
|     O peration        Tel: +44 (0)1293 821272             |
|     A nd              Email: [EMAIL PROTECTED]       |
|     M anipulation     URL: http://www.Nabla.co.uk         |
\*---------------------------------------------------------*/

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to