PDA

View Full Version : NURBS trimming issue



sast5602
05-11-2009, 12:38 AM
Hello,

I made part of sphere using gluNurbsSurface() function. It looks like this:
http://img27.imageshack.us/img27/4343/18spherebeforetrim.jpg
I want to trim it using gluNurbsCurve() function. Trim curve will go counter-clockwise. These curves will be at the each side of NURBS surface. It looks like this:
http://img24.imageshack.us/img24/8962/trimmingcurves.jpg
So finally, I put everything together:


gluBeginSurface(nobj); //begin my surface

gluNurbsSurface(...myNURBS...); //draw my part of sphere

gluBeginTrim(nobj);
gluNurbsCurve(...curve_1...); //first trimmig curve
gluNurbsCurve(...curve_2...); //second trimming curve
gluNurbsCurve(...curve_3...); //3rd trimming curve
gluEndTrim(nobj);

gluEndSurface(nobj); //end my surface

After this procedure, I should get same image like first, full NURB, but I get just part of my NURB. It looks like this after trimming:
http://img26.imageshack.us/img26/5443/18sphereaftertrim.jpg
Any ideas, what I am doing wrong? I will wait any suggestions and ideas. Thank You

rahul33
04-08-2011, 03:57 AM
When the trimming curve is in counter clock wise direction then the external part is discarded and the internal portion is retained so if u want to make the whole in your nurbs surface then rotate ur nurbs curve in the clockwise direction.