15bd8deadSopenharmony_ciXXX - Not complete yet!!! 25bd8deadSopenharmony_ciName 35bd8deadSopenharmony_ci 45bd8deadSopenharmony_ci SGIX_nurbs_eval 55bd8deadSopenharmony_ci 65bd8deadSopenharmony_ciName Strings 75bd8deadSopenharmony_ci 85bd8deadSopenharmony_ci GL_SGIX_nurbs_eval 95bd8deadSopenharmony_ci 105bd8deadSopenharmony_ciVersion 115bd8deadSopenharmony_ci 125bd8deadSopenharmony_ci $Date: 1998/02/12 18:24:45 $ $Revision: 1.6 $ 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciNumber 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci XXX 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciDependencies 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci None 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciOverview 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci This extension adds a new evaluators type, NURBS. NURBS are a compact 255bd8deadSopenharmony_ci representation of the datasets that many CAD and entertainment industry 265bd8deadSopenharmony_ci customers are already using. The creation of a new interface allows for 275bd8deadSopenharmony_ci levels of performance not achievable with the current evaluators API. 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci The current evaluators interface supports only Bezier curves, which suffer 305bd8deadSopenharmony_ci from several disadvantages: Beziers are a wasteful of memory and graphics 315bd8deadSopenharmony_ci interface bandwidth; Beziers representations are often larger than 325bd8deadSopenharmony_ci the representations of the tesselated surfaces they are used to render; 335bd8deadSopenharmony_ci Beziers are not a native format used by CAD and entertainment applications. 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci In the new NURBS extension, every effort has been made to extend the 365bd8deadSopenharmony_ci existing evaluators interface, rather than define a completely new set of 375bd8deadSopenharmony_ci interfaces and state. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciIssues 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci * Should it be NURB or NURBS? 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci I'm choosing NURBS since it matches the GLU spec and glu extensions. 445bd8deadSopenharmony_ci This does not agree with Farin's usage in the literature, but does agree 455bd8deadSopenharmony_ci with many other authors. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ciNew Procedures and Functions 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci void NurbsKnots1SGIX[fd]( enum target, 505bd8deadSopenharmony_ci int uknotcount, T *uknots ); 515bd8deadSopenharmony_ci void NurbsKnots2SGIX[fd]( enum target, 525bd8deadSopenharmony_ci int uknotcount, int vknotcount, 535bd8deadSopenharmony_ci T *uknots, T *vknots ); 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ciNew Tokens 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and 585bd8deadSopenharmony_ci by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and 595bd8deadSopenharmony_ci GetDoublev: 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci MAP1_VERTEX_3_NURBS_SGIX 0x81CB 625bd8deadSopenharmony_ci MAP1_VERTEX_4_NURBS_SGIX 0x81CC 635bd8deadSopenharmony_ci MAP1_INDEX_NURBS_SGIX 0x81CD 645bd8deadSopenharmony_ci MAP1_COLOR_4_NURBS_SGIX 0x81CE 655bd8deadSopenharmony_ci MAP1_NORMAL_NURBS_SGIX 0x81CF 665bd8deadSopenharmony_ci MAP1_TEXTURE_COORD_1_NURBS_SGIX 0x81E0 675bd8deadSopenharmony_ci MAP1_TEXTURE_COORD_2_NURBS_SGIX 0x81E1 685bd8deadSopenharmony_ci MAP1_TEXTURE_COORD_3_NURBS_SGIX 0x81E2 695bd8deadSopenharmony_ci MAP1_TEXTURE_COORD_4_NURBS_SGIX 0x81E3 705bd8deadSopenharmony_ci MAP2_VERTEX_3_NURBS_SGIX 0x81E4 715bd8deadSopenharmony_ci MAP2_VERTEX_4_NURBS_SGIX 0x81E5 725bd8deadSopenharmony_ci MAP2_INDEX_NURBS_SGIX 0x81E6 735bd8deadSopenharmony_ci MAP2_COLOR_4_NURBS_SGIX 0x81E7 745bd8deadSopenharmony_ci MAP2_NORMAL_NURBS_SGIX 0x81E8 755bd8deadSopenharmony_ci MAP2_TEXTURE_COORD_1_NURBS_SGIX 0x81E9 765bd8deadSopenharmony_ci MAP2_TEXTURE_COORD_2_NURBS_SGIX 0x81EA 775bd8deadSopenharmony_ci MAP2_TEXTURE_COORD_3_NURBS_SGIX 0x81EB 785bd8deadSopenharmony_ci MAP2_TEXTURE_COORD_4_NURBS_SGIX 0x81EC 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci Accepted by the <value> parameter of GetMap[ifd]v: 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci NURBS_KNOT_COUNT_SGIX 0x81ED 835bd8deadSopenharmony_ci NURBS_KNOT_VECTOR_SGIX 0x81EE 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci None 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization) 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci None 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 945bd8deadSopenharmony_ciand the Frame Buffer) 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci None 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions) 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci Evaluators are extended to support both the existing specification, which 1015bd8deadSopenharmony_ci is a Bezier formulation, and a new NURBS formulation. New enable tokens 1025bd8deadSopenharmony_ci are used to enable NURBS evaluation when it is desired. 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci Basis Functions: 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci NURBS polynomials for curves are defined as follows: 1075bd8deadSopenharmony_ci Consider the R^k-valued polynomial q(u) is defined by 1085bd8deadSopenharmony_ci q(u) = sum(i=0,n) N_i^d(u) * R_i 1095bd8deadSopenharmony_ci with N_i^d(u) = N_i^(d-1)(u) * (u-u(i-1))/(u(i+d-1)-u(i-1)) + 1105bd8deadSopenharmony_ci N(i+1)^(d-1)(u) * (u(i+d)-u)/(u(i+d)-u_i) 1115bd8deadSopenharmony_ci the i_th NURBS basis polynomial of degree d. 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci Each R_i is a control point, and each u_i is a knot-value. 1145bd8deadSopenharmony_ci The complete set of {u_i} values is called the knot vector. 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci Map1[fd]: 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci When NURBS evaluation is enabled, the <order> parameter to the Map1[fd] 1195bd8deadSopenharmony_ci function is not really the mathematical order of the NURBS polynomial. 1205bd8deadSopenharmony_ci Instead, the <order> parameter merely determines the size of the array 1215bd8deadSopenharmony_ci given as input to Map1[fd] or Map2[fd]. In other words, the <order> 1225bd8deadSopenharmony_ci parameter only determines the size of the valid GL state for the map 1235bd8deadSopenharmony_ci array; it does not really capture the mathematical order of the curve or 1245bd8deadSopenharmony_ci surface. 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci Note that it is still true that the <order> parameter to Map1[fd] is equal 1275bd8deadSopenharmony_ci to n+1 in the equation defining NURBS polynomials at the beginning of this 1285bd8deadSopenharmony_ci section. 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci Map2[fd]: 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci NURBS polynomials for surfaces are defined as bivariate polynomials using 1335bd8deadSopenharmony_ci the same N_i^d basis functions as NURBS curves: 1345bd8deadSopenharmony_ci q(u,v) = sum(i=0,n) sum(j=0,m) N_i^d(u) * N_j^c(v) * R_ij 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci NurbsKnots1SGIX: 1375bd8deadSopenharmony_ci NurbsKnots2SGIX: 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci The <target> parameter must be one of GL_MAP1_VERTEX_3, GL_MAP1_VERTEX_4, 1405bd8deadSopenharmony_ci GL_MAP1_COLOR_4, GL_MAP1_INDEX, GL_MAP1_NORMAL, GL_MAP1_TEXTURE_COORD_1, 1415bd8deadSopenharmony_ci GL_MAP1_TEXTURE_COORD_2, GL_MAP1_TEXTURE_COORD_3, GL_MAP1_TEXTURE_COORD_4, 1425bd8deadSopenharmony_ci GL_MAP2_VERTEX_3, GL_MAP2_VERTEX_4, GL_MAP2_COLOR_4, GL_MAP2_INDEX, 1435bd8deadSopenharmony_ci GL_MAP2_NORMAL, GL_MAP2_TEXTURE_COORD_1, GL_MAP2_TEXTURE_COORD_2, 1445bd8deadSopenharmony_ci GL_MAP2_TEXTURE_COORD_3, or GL_MAP2_TEXTURE_COORD_4. 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci The knots vectors are defined by the new functions NurbsKnots1SGIX and 1475bd8deadSopenharmony_ci NurbsKnots2SGIX. The size of the knot vectors, <uknotcount> and 1485bd8deadSopenharmony_ci <vknotcount> implicitly define the degree of the NURBS curves or surfaces 1495bd8deadSopenharmony_ci defined. For curves, the degree is defined as: 1505bd8deadSopenharmony_ci d = <uknotcount> - <uorder> + 1 1515bd8deadSopenharmony_ci For surfaces, the second degree is defined as: 1525bd8deadSopenharmony_ci c = <vknotcount> - <vorder> + 1 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci The entries from the <uknots> and <vknots> input arrays are immediately 1555bd8deadSopenharmony_ci copied by the GL by the completion of this procedure. 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci EvalCoord[12][fd]: 1585bd8deadSopenharmony_ci EvalCoord[12][fd]v: 1595bd8deadSopenharmony_ci EvalPoint[12]: 1605bd8deadSopenharmony_ci EvalMesh[12]: 1615bd8deadSopenharmony_ci 1625bd8deadSopenharmony_ci For all of the new MAP1_XXX_NURBS tokens, when MAP1_XXX_NURBS is disabled, 1635bd8deadSopenharmony_ci the evaluation functions, EvalCoord1[fd], EvalCoord1[fd]v, EvalPoint1, and 1645bd8deadSopenharmony_ci EvalMesh1 all evaluate Bezier curves for the given map as usual. When 1655bd8deadSopenharmony_ci MAP1_XXX_NURBS is enabled, the evaluation functions instead evaluate NURBS 1665bd8deadSopenharmony_ci curves. Similarly, the new MAP2_XXX_NURBS tokens are used to enable NURBS 1675bd8deadSopenharmony_ci surface evaluation for the functions EvalCoord2[fd], EvalCoord2[fd]v, 1685bd8deadSopenharmony_ci EvalPoint2, and EvalMesh2. 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests) 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci None 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ciAdditions to the GLX Specification 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci None 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ciGLX Protocol 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci XXX - Not figured out yet. 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ciDependencies on other extensions 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci None 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ciErrors 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci INVALID_VALUE is generated if NurbsKnots[12]SGIX parameter <uknotcount> or 1895bd8deadSopenharmony_ci <vknotcount> are negative or greater that or equal to MAX_EVAL_ORDER. 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci INVALID_VALUE is generated if <uorder> > <uknotcount>+1 when any of 1925bd8deadSopenharmony_ci EvalCoord1[fd], EvalCoord1[fd]v, EvalPoint1, or EvalMesh1 are called if 1935bd8deadSopenharmony_ci both of MAP1_XXX and MAP1_XXX_NURBS_SGIX are enabled. 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci INVALID_VALUE is generated if <uorder> > <uknotcount>+1 or <vorder> > 1965bd8deadSopenharmony_ci <vknotcount>+1 when any of EvalCoord2[fd], EvalCoord2[fd]v, EvalPoint2, or 1975bd8deadSopenharmony_ci EvalMesh2 are called if both of MAP2_XXX and MAP2_XXX_NURBS_SGIX are 1985bd8deadSopenharmony_ci enabled. 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ciNew State 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci Initial 2035bd8deadSopenharmony_ci Get Value Get Command Type Value Attrib 2045bd8deadSopenharmony_ci --------- ----------- ---- ------- ------ 2055bd8deadSopenharmony_ci MAP1_VERTEX_3_NURBS_SGIX glIsEnabled B FALSE eval/enable 2065bd8deadSopenharmony_ci MAP1_VERTEX_4_NURBS_SGIX glIsEnabled B FALSE eval/enable 2075bd8deadSopenharmony_ci MAP1_INDEX_NURBS_SGIX glIsEnabled B FALSE eval/enable 2085bd8deadSopenharmony_ci MAP1_COLOR_4_NURBS_SGIX glIsEnabled B FALSE eval/enable 2095bd8deadSopenharmony_ci MAP1_NORMAL_NURBS_SGIX glIsEnabled B FALSE eval/enable 2105bd8deadSopenharmony_ci MAP1_TEXTURE_COORD_1_NURBS_SGIX glIsEnabled B FALSE eval/enable 2115bd8deadSopenharmony_ci MAP1_TEXTURE_COORD_2_NURBS_SGIX glIsEnabled B FALSE eval/enable 2125bd8deadSopenharmony_ci MAP1_TEXTURE_COORD_3_NURBS_SGIX glIsEnabled B FALSE eval/enable 2135bd8deadSopenharmony_ci MAP1_TEXTURE_COORD_4_NURBS_SGIX glIsEnabled B FALSE eval/enable 2145bd8deadSopenharmony_ci MAP2_VERTEX_3_NURBS_SGIX glIsEnabled B FALSE eval/enable 2155bd8deadSopenharmony_ci MAP2_VERTEX_4_NURBS_SGIX glIsEnabled B FALSE eval/enable 2165bd8deadSopenharmony_ci MAP2_INDEX_NURBS_SGIX glIsEnabled B FALSE eval/enable 2175bd8deadSopenharmony_ci MAP2_COLOR_4_NURBS_SGIX glIsEnabled B FALSE eval/enable 2185bd8deadSopenharmony_ci MAP2_NORMAL_NURBS_SGIX glIsEnabled B FALSE eval/enable 2195bd8deadSopenharmony_ci MAP2_TEXTURE_COORD_1_NURBS_SGIX glIsEnabled B FALSE eval/enable 2205bd8deadSopenharmony_ci MAP2_TEXTURE_COORD_2_NURBS_SGIX glIsEnabled B FALSE eval/enable 2215bd8deadSopenharmony_ci MAP2_TEXTURE_COORD_3_NURBS_SGIX glIsEnabled B FALSE eval/enable 2225bd8deadSopenharmony_ci MAP2_TEXTURE_COORD_4_NURBS_SGIX glIsEnabled B FALSE eval/enable 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci NURBS_KNOT_COUNT_SGIX GetMapiv 9XZ+ 0 2255bd8deadSopenharmony_ci NURBS_KNOT_COUNT_SGIX GetMapiv 9X2XZ+ 0,0 2265bd8deadSopenharmony_ci NURBS_KNOT_VECTOR_SGIX GetMapdv 9X7*XR undef. 2275bd8deadSopenharmony_ci NURBS_KNOT_VECTOR_SGIX GetMapdv 9X2X7*XR undef. 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ciNew Implementation Dependent State 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci None 233