| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
| 2 | <!-- saved from url=(0013)about:internet --> |
| 3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>gluNurbsSurface</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="gluNurbsSurface"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>gluNurbsSurface — define the shape of a NURBS surface</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">gluNurbsSurface</b>(</code></td><td>GLUnurbs* </td><td><var class="pdparam">nurb</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">sKnotCount</var>, </td></tr><tr><td> </td><td>GLfloat* </td><td><var class="pdparam">sKnots</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">tKnotCount</var>, </td></tr><tr><td> </td><td>GLfloat* </td><td><var class="pdparam">tKnots</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">sStride</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">tStride</var>, </td></tr><tr><td> </td><td>GLfloat* </td><td><var class="pdparam">control</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">sOrder</var>, </td></tr><tr><td> </td><td>GLint </td><td><var class="pdparam">tOrder</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">type</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>nurb</code></em></span></dt><dd><p> |
| 4 | Specifies the NURBS object (created with <a class="citerefentry" href="gluNewNurbsRenderer.xml"><span class="citerefentry"><span class="refentrytitle">gluNewNurbsRenderer</span></span></a>). |
| 5 | </p></dd><dt><span class="term"><em class="parameter"><code>sKnotCount</code></em></span></dt><dd><p> |
| 6 | Specifies the number of knots in the parametric <span class="emphasis"><em>u</em></span> direction. |
| 7 | </p></dd><dt><span class="term"><em class="parameter"><code>sKnots</code></em></span></dt><dd><p> |
| 8 | Specifies an array of <em class="parameter"><code>sKnotCount</code></em> nondecreasing knot values in the parametric |
| 9 | <span class="emphasis"><em>u</em></span> direction. |
| 10 | </p></dd><dt><span class="term"><em class="parameter"><code>tKnotCount</code></em></span></dt><dd><p> |
| 11 | Specifies the number of knots in the parametric <span class="emphasis"><em>v</em></span> direction. |
| 12 | </p></dd><dt><span class="term"><em class="parameter"><code>tKnots</code></em></span></dt><dd><p> |
| 13 | Specifies an array of <em class="parameter"><code>tKnotCount</code></em> nondecreasing knot values in the parametric |
| 14 | <span class="emphasis"><em>v</em></span> direction. |
| 15 | </p></dd><dt><span class="term"><em class="parameter"><code>sStride</code></em></span></dt><dd><p> |
| 16 | Specifies the offset (as a number of single-precision floating-point values) |
| 17 | between successive control points in the parametric <span class="emphasis"><em>u</em></span> direction |
| 18 | in <em class="parameter"><code>control</code></em>. |
| 19 | </p></dd><dt><span class="term"><em class="parameter"><code>tStride</code></em></span></dt><dd><p> |
| 20 | Specifies the offset (in single-precision floating-point values) |
| 21 | between successive control points in the parametric <span class="emphasis"><em>v</em></span> direction |
| 22 | in <em class="parameter"><code>control</code></em>. |
| 23 | </p></dd><dt><span class="term"><em class="parameter"><code>control</code></em></span></dt><dd><p> |
| 24 | Specifies an array containing control points for the NURBS surface. |
| 25 | The offsets between successive control points in the parametric <span class="emphasis"><em>u</em></span> |
| 26 | and <span class="emphasis"><em>v</em></span> directions are given by <em class="parameter"><code>sStride</code></em> and <em class="parameter"><code>tStride</code></em>. |
| 27 | </p></dd><dt><span class="term"><em class="parameter"><code>sOrder</code></em></span></dt><dd><p> |
| 28 | Specifies the order of the NURBS surface in the parametric <span class="emphasis"><em>u</em></span> |
| 29 | direction. The order is one more than the degree, hence |
| 30 | a surface that is cubic in <span class="emphasis"><em>u</em></span> has a <span class="emphasis"><em>u</em></span> order of 4. |
| 31 | </p></dd><dt><span class="term"><em class="parameter"><code>tOrder</code></em></span></dt><dd><p> |
| 32 | Specifies the order of the NURBS surface in the parametric <span class="emphasis"><em>v</em></span> |
| 33 | direction. The order is one more than the degree, hence |
| 34 | a surface that is cubic in <span class="emphasis"><em>v</em></span> has a <span class="emphasis"><em>v</em></span> order of 4. |
| 35 | </p></dd><dt><span class="term"><em class="parameter"><code>type</code></em></span></dt><dd><p> |
| 36 | Specifies type of the surface. <em class="parameter"><code>type</code></em> can be any of the valid |
| 37 | two-dimensional evaluator types (such as <code class="constant">GLU_MAP2_VERTEX_3</code> or |
| 38 | <code class="constant">GLU_MAP2_COLOR_4</code>). |
| 39 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> |
| 40 | Use <code class="function">gluNurbsSurface</code> within a NURBS (Non-Uniform Rational B-Spline) surface |
| 41 | definition to describe the shape of a NURBS surface (before |
| 42 | any trimming). To mark the beginning of |
| 43 | a NURBS surface definition, use the <a class="citerefentry" href="gluBeginSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluBeginSurface</span></span></a> command. |
| 44 | To mark the end of a NURBS surface definition, use the |
| 45 | <a class="citerefentry" href="gluEndSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluEndSurface</span></span></a> command. Call <code class="function">gluNurbsSurface</code> within a NURBS |
| 46 | surface definition only. |
| 47 | </p><p> |
| 48 | Positional, texture, and color coordinates are associated |
| 49 | with a surface by presenting each as a separate <code class="function">gluNurbsSurface</code> between a |
| 50 | <a class="citerefentry" href="gluBeginSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluBeginSurface</span></span></a>/<a class="citerefentry" href="gluEndSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluEndSurface</span></span></a> pair. No more than |
| 51 | one call to <code class="function">gluNurbsSurface</code> for each of color, position, and texture |
| 52 | data can be made within a single <a class="citerefentry" href="gluBeginSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluBeginSurface</span></span></a>/<a class="citerefentry" href="gluEndSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluEndSurface</span></span></a> |
| 53 | pair. Exactly one call must be made to describe the position of the |
| 54 | surface (a <em class="parameter"><code>type</code></em> of <code class="constant">GLU_MAP2_VERTEX_3</code> or <code class="constant">GLU_MAP2_VERTEX_4</code>). |
| 55 | </p><p> |
| 56 | A NURBS surface can be trimmed by using the commands |
| 57 | <a class="citerefentry" href="gluNurbsCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCurve</span></span></a> and <a class="citerefentry" href="gluPwlCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluPwlCurve</span></span></a> between calls to |
| 58 | <a class="citerefentry" href="gluBeginTrim.xml"><span class="citerefentry"><span class="refentrytitle">gluBeginTrim</span></span></a> and <a class="citerefentry" href="gluEndTrim.xml"><span class="citerefentry"><span class="refentrytitle">gluEndTrim</span></span></a>. |
| 59 | </p><p> |
| 60 | Note that a <code class="function">gluNurbsSurface</code> with <em class="parameter"><code>sKnotCount</code></em> knots in the <span class="emphasis"><em>u</em></span> direction |
| 61 | and <em class="parameter"><code>tKnotCount</code></em> knots in the <span class="emphasis"><em>v</em></span> direction with orders |
| 62 | <em class="parameter"><code>sOrder</code></em> and <em class="parameter"><code>tOrder</code></em> must have |
| 63 | (<em class="parameter"><code>sKnotCount</code></em> - <em class="parameter"><code>sOrder</code></em>) |
| 64 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">times</mml:mi></mml:math> |
| 65 | (<em class="parameter"><code>tKnotCount</code></em> - <em class="parameter"><code>tOrder</code></em>) control points. |
| 66 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="example"></a><h2>Example</h2><p> |
| 67 | The following commands render a textured NURBS surface with normals; |
| 68 | the texture coordinates and normals are also NURBS surfaces: |
| 69 | </p><pre class="programlisting"> |
| 70 | gluBeginSurface(nobj); |
| 71 | gluNurbsSurface(nobj, ..., GL_MAP2_TEXTURE_COORD_2); |
| 72 | gluNurbsSurface(nobj, ..., GL_MAP2_NORMAL); |
| 73 | gluNurbsSurface(nobj, ..., GL_MAP2_VERTEX_4); |
| 74 | gluEndSurface(nobj); |
| 75 | </pre><p> |
| 76 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> |
| 77 | <a class="citerefentry" href="gluBeginSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluBeginSurface</span></span></a>, |
| 78 | <a class="citerefentry" href="gluBeginTrim.xml"><span class="citerefentry"><span class="refentrytitle">gluBeginTrim</span></span></a>, |
| 79 | <a class="citerefentry" href="gluNewNurbsRenderer.xml"><span class="citerefentry"><span class="refentrytitle">gluNewNurbsRenderer</span></span></a>, |
| 80 | <a class="citerefentry" href="gluNurbsCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCurve</span></span></a>, |
| 81 | <a class="citerefentry" href="gluPwlCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluPwlCurve</span></span></a> |
| 82 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> |
| 83 | Copyright <span class="trademark"></span>© 1991-2006 |
| 84 | Silicon Graphics, Inc. This document is licensed under the SGI |
| 85 | Free Software B License. For details, see |
| 86 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. |
| 87 | </p></div></div></body></html> |