> MIME-Version: 1.0
> Date: Thu, 17 May 2001 11:54:47 -0700
> From: Rajamiyer Ravichandran <[EMAIL PROTECTED]>
> Subject: [JAVA3D] Big problem with Triangulator
> Comments: To: Dan Petersen <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
>
> I don't like about that is when I triangulate a
> trimmed NURBS surface with holes in it, the
> triangulation is correct but all the normals generated
> are in the opposite direction of the NURBS surface.
>
> In my case the BURBS surface has a normal (0,0,1.0)
> but the normals generated by the triangulator is
> (0,0,-1). If this is consistent, then I can do the
> geometryinfo.reverse() to solve this problem. But it
> does not happen all the time.

This sounds like it's probably a winding problem.  When defining your
geometry, you need to list the vertices in a counter-clockwise order
with respect to which side you want to be the front of the polygon.

But I'm confused about parts of what you wrote.  The triangulator
doesn't generate normals for you - the NormalGenerator does that.  I am
curious why you'd be using the triangulator with NURBS - NURBS are
curved surfaces and polygons are flat.  Is your NURBS algorithm
outputting polygons with >4 sides?  I'd assume your NURBS code would
output triangles or quads, and you'd put those into a GeometryInfo to
generate normals and then Stripify.

If your NURBS code isn't outputting triangles with consistent winding,
then you can always turn on two-sided lighting (see javadoc for "Light"
under "Two-sided Lighting of Polygons."

-Paul

===========================================================================
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