Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cracks on NURBS sphere



> As I promised this morning, I have made the example test program. I am
> sending you now the .c file. It is based on nurbs.c from Apple's OpenGL SDK.
> I just modified it to reflect some settings we use in VecorWorks and also,
> of course, fed the NURBS geometry data for modeling a sphere. I tested this
> file on both Mac and Windows, and it is very obvious that the sphere
> rendered on windows is very smooth, but on Mac, there are cracks on the
> surface, and no matter how you adjust the camera, the cracks are there.

they're not quite cracks ('cracks' IME are visible gaps in the
geometry), but rather discontinuities in the normals.

the sample code was generating normals automatically:

glEnable(GL_AUTO_NORMAL);

commenting this out and adding a second evaluation:

gluNurbsSurface(theNurb,
S_NUMKNOTS, sknots,
T_NUMKNOTS, tknots,
4 * T_NUMPOINTS,
4,
ctlpoints,
S_ORDER, T_ORDER,
GL_MAP2_NORMAL);

gluNurbsSurface(theNurb,
S_NUMKNOTS, sknots,
T_NUMKNOTS, tknots,
4 * T_NUMPOINTS,
4,
ctlpoints,
S_ORDER, T_ORDER,
GL_MAP2_VERTEX_4);
gluEndSurface(theNurb);

resulted in better rendering of the sphere.

there is still some slight joining artifacts, but this looks to
be a minor tesselation issue and not massive weirdness.

afaik, GL_AUTO_NORMAL should work with NurbsSurfaces though, so we'll
have to keep looking at this.

=td=




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.