PDA

View Full Version : NURBS circular arc problem



EnnoF
07-31-2009, 09:01 AM
Using GLU 1.3 I thought that control points and knots

float uctls[UCTLS][USTRIDE] = {{1,0,0,1}, {1,1,0,H}, 0,1,0,1}};
GLfloat uknots[UORDER + UCTLS] = {0.0, 0.0, 0.0, 1.0, 1.0, 1.0};

where H = sqrt(2.0)/2.0 should cause

gluNurbsCurve(nurb, UCTLS + UORDER, uknots, USTRIDE, (float*) uctls, UORDER, GL_MAP1_VERTEX_4);

to draw a quarter unit circle in the 1st quadrant.
In fact I get a arc strongly bulging in the (1,1) direction.

When using H = 1.0 as homogeneous coordinate I get (against my expectation) something that closely resembles a quarter circle although still very slightly bulging.

What do I miss?
EnnoF

EnnoF
08-01-2009, 07:24 AM
I coded the 2nd controlpoint with affine coordinates (1,1,0) and weight H as homogeneous coordinates (1,1,0,H). WRONG !!

I should have multiplied all coordinates by H, so the 2nd control point should be {H, H, 0, H};

Then my quarter circle is Ok.
Enno

awhig
08-05-2009, 04:59 PM
Thanks for the info.!!