| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" |
| 3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> |
| 4 | <refentry id="gluNurbsCurve"> |
| 5 | <refmeta> |
| 6 | <refmetainfo> |
| 7 | <copyright> |
| 8 | <year>1991-2006</year> |
| 9 | <holder>Silicon Graphics, Inc.</holder> |
| 10 | </copyright> |
| 11 | </refmetainfo> |
| 12 | <refentrytitle>gluNurbsCurve</refentrytitle> |
| 13 | <manvolnum>3G</manvolnum> |
| 14 | </refmeta> |
| 15 | <refnamediv> |
| 16 | <refname>gluNurbsCurve</refname> |
| 17 | <refpurpose>define the shape of a NURBS curve</refpurpose> |
| 18 | </refnamediv> |
| 19 | <refsynopsisdiv><title>C Specification</title> |
| 20 | <funcsynopsis> |
| 21 | <funcprototype> |
| 22 | <funcdef>void <function>gluNurbsCurve</function></funcdef> |
| 23 | <paramdef>GLUnurbs* <parameter>nurb</parameter></paramdef> |
| 24 | <paramdef>GLint <parameter>knotCount</parameter></paramdef> |
| 25 | <paramdef>GLfloat * <parameter>knots</parameter></paramdef> |
| 26 | <paramdef>GLint <parameter>stride</parameter></paramdef> |
| 27 | <paramdef>GLfloat * <parameter>control</parameter></paramdef> |
| 28 | <paramdef>GLint <parameter>order</parameter></paramdef> |
| 29 | <paramdef>GLenum <parameter>type</parameter></paramdef> |
| 30 | </funcprototype> |
| 31 | </funcsynopsis> |
| 32 | </refsynopsisdiv> |
| 33 | <!-- eqn: ignoring delim $$ --> |
| 34 | <refsect1 id="parameters"><title>Parameters</title> |
| 35 | <variablelist> |
| 36 | <varlistentry> |
| 37 | <term><parameter>nurb</parameter></term> |
| 38 | <listitem> |
| 39 | <para> |
| 40 | Specifies the NURBS object (created with <citerefentry><refentrytitle>gluNewNurbsRenderer</refentrytitle></citerefentry>). |
| 41 | </para> |
| 42 | </listitem> |
| 43 | </varlistentry> |
| 44 | <varlistentry> |
| 45 | <term><parameter>knotCount</parameter></term> |
| 46 | <listitem> |
| 47 | <para> |
| 48 | Specifies the number of knots in <parameter>knots</parameter>. |
| 49 | <parameter>knotCount</parameter> equals the number of control points plus the order. |
| 50 | </para> |
| 51 | </listitem> |
| 52 | </varlistentry> |
| 53 | <varlistentry> |
| 54 | <term><parameter>knots</parameter></term> |
| 55 | <listitem> |
| 56 | <para> |
| 57 | Specifies an array of <parameter>knotCount</parameter> nondecreasing knot values. |
| 58 | </para> |
| 59 | </listitem> |
| 60 | </varlistentry> |
| 61 | <varlistentry> |
| 62 | <term><parameter>stride</parameter></term> |
| 63 | <listitem> |
| 64 | <para> |
| 65 | Specifies the offset (as a number of single-precision floating-point values) |
| 66 | between successive curve control points. |
| 67 | </para> |
| 68 | </listitem> |
| 69 | </varlistentry> |
| 70 | <varlistentry> |
| 71 | <term><parameter>control</parameter></term> |
| 72 | <listitem> |
| 73 | <para> |
| 74 | Specifies a pointer to an array of control points. The coordinates must |
| 75 | agree with <parameter>type</parameter>, specified below. |
| 76 | </para> |
| 77 | </listitem> |
| 78 | </varlistentry> |
| 79 | <varlistentry> |
| 80 | <term><parameter>order</parameter></term> |
| 81 | <listitem> |
| 82 | <para> |
| 83 | Specifies the order of the NURBS curve. <parameter>order</parameter> equals degree + 1, hence |
| 84 | a cubic curve has an order of 4. |
| 85 | </para> |
| 86 | </listitem> |
| 87 | </varlistentry> |
| 88 | <varlistentry> |
| 89 | <term><parameter>type</parameter></term> |
| 90 | <listitem> |
| 91 | <para> |
| 92 | Specifies the type of the curve. If this curve is defined within a |
| 93 | <citerefentry><refentrytitle>gluBeginCurve</refentrytitle></citerefentry>/<citerefentry><refentrytitle>gluEndCurve</refentrytitle></citerefentry> pair, then |
| 94 | the type can be any of the valid |
| 95 | one-dimensional evaluator types (such as <constant>GLU_MAP1_VERTEX_3</constant> or |
| 96 | <constant>GLU_MAP1_COLOR_4</constant>). Between a <citerefentry><refentrytitle>gluBeginTrim</refentrytitle></citerefentry>/<citerefentry><refentrytitle>gluEndTrim</refentrytitle></citerefentry> pair, |
| 97 | the only valid types are <constant>GLU_MAP1_TRIM_2</constant> and <constant>GLU_MAP1_TRIM_3</constant>. |
| 98 | </para> |
| 99 | </listitem> |
| 100 | </varlistentry> |
| 101 | </variablelist> |
| 102 | </refsect1> |
| 103 | <refsect1 id="description"><title>Description</title> |
| 104 | <para> |
| 105 | Use <function>gluNurbsCurve</function> to describe a NURBS curve. |
| 106 | </para> |
| 107 | <para> |
| 108 | When <function>gluNurbsCurve</function> appears between a <citerefentry><refentrytitle>gluBeginCurve</refentrytitle></citerefentry>/<citerefentry><refentrytitle>gluEndCurve</refentrytitle></citerefentry> pair, it is |
| 109 | used to describe a curve to be rendered. |
| 110 | Positional, texture, and color coordinates are associated |
| 111 | by presenting each as a separate <function>gluNurbsCurve</function> between a |
| 112 | <citerefentry><refentrytitle>gluBeginCurve</refentrytitle></citerefentry>/<citerefentry><refentrytitle>gluEndCurve</refentrytitle></citerefentry> pair. No more than |
| 113 | one call to <function>gluNurbsCurve</function> for each of color, position, and texture |
| 114 | data can be made within a single <citerefentry><refentrytitle>gluBeginCurve</refentrytitle></citerefentry>/<citerefentry><refentrytitle>gluEndCurve</refentrytitle></citerefentry> |
| 115 | pair. Exactly one call must be made to describe the position of the |
| 116 | curve (a <parameter>type</parameter> of <constant>GLU_MAP1_VERTEX_3</constant> or <constant>GLU_MAP1_VERTEX_4</constant>). |
| 117 | </para> |
| 118 | <para> |
| 119 | When <function>gluNurbsCurve</function> appears between a <citerefentry><refentrytitle>gluBeginTrim</refentrytitle></citerefentry>/<citerefentry><refentrytitle>gluEndTrim</refentrytitle></citerefentry> pair, it is |
| 120 | used to describe a trimming curve on a NURBS surface. If <parameter>type</parameter> is |
| 121 | <constant>GLU_MAP1_TRIM_2</constant>, then it describes a curve in two-dimensional (<emphasis>u</emphasis> |
| 122 | and <emphasis>v</emphasis>) |
| 123 | parameter space. If it is <constant>GLU_MAP1_TRIM_3</constant>, then it describes a |
| 124 | curve in two-dimensional homogeneous (<emphasis>u</emphasis>, <emphasis>v</emphasis>, and <emphasis>w</emphasis>) |
| 125 | parameter space. |
| 126 | See the <citerefentry><refentrytitle>gluBeginTrim</refentrytitle></citerefentry> reference page for more discussion about trimming |
| 127 | curves. |
| 128 | </para> |
| 129 | </refsect1> |
| 130 | <refsect1 id="example"><title>Example</title> |
| 131 | <para> |
| 132 | The following commands render a textured NURBS curve with normals: |
| 133 | <programlisting> |
| 134 | gluBeginCurve(nobj); |
| 135 | gluNurbsCurve(nobj, ..., GL_MAP1_TEXTURE_COORD_2); |
| 136 | gluNurbsCurve(nobj, ..., GL_MAP1_NORMAL); |
| 137 | gluNurbsCurve(nobj, ..., GL_MAP1_VERTEX_4); |
| 138 | gluEndCurve(nobj); |
| 139 | </programlisting> |
| 140 | </para> |
| 141 | </refsect1> |
| 142 | <refsect1 id="notes"><title>Notes</title> |
| 143 | <para> |
| 144 | To define trim curves that stitch well, use <citerefentry><refentrytitle>gluPwlCurve</refentrytitle></citerefentry>. |
| 145 | </para> |
| 146 | </refsect1> |
| 147 | <refsect1 id="seealso"><title>See Also</title> |
| 148 | <para> |
| 149 | <citerefentry><refentrytitle>gluBeginCurve</refentrytitle></citerefentry>, |
| 150 | <citerefentry><refentrytitle>gluBeginTrim</refentrytitle></citerefentry>, |
| 151 | <citerefentry><refentrytitle>gluNewNurbsRenderer</refentrytitle></citerefentry>, |
| 152 | <citerefentry><refentrytitle>gluPwlCurve</refentrytitle></citerefentry> |
| 153 | </para> |
| 154 | </refsect1> |
| 155 | <refsect1 id="Copyright"><title>Copyright</title> |
| 156 | <para> |
| 157 | Copyright <trademark class="copyright"></trademark> 1991-2006 |
| 158 | Silicon Graphics, Inc. This document is licensed under the SGI |
| 159 | Free Software B License. For details, see |
| 160 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. |
| 161 | </para> |
| 162 | </refsect1> |
| 163 | </refentry> |