<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glMapGrid</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.09 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glMap2.3G.xml" title="glMap2"/><link rel="next" href="glMaterial.3G.xml" title="glMaterial"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glMapGrid</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glMap2.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glMaterial.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glMapGrid.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glMapGrid.3G-name"/><h2>Name</h2><p>glMapGrid1d, glMapGrid1f, glMapGrid2d, glMapGrid2f &#8212; define a one- or two-dimensional mesh</p></div><div class="refsynopsisdiv"><a name="glMapGrid.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glMapGrid1d</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLint <i><tt>un</tt></i>, GLdouble <i><tt>u1</tt></i>, GLdouble <i><tt>u2</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>glMapGrid1f</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLint <i><tt>un</tt></i>, GLfloat <i><tt>u1</tt></i>, GLfloat <i><tt>u2</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>glMapGrid2d</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLint <i><tt>un</tt></i>, GLdouble <i><tt>u1</tt></i>, GLdouble <i><tt>u2</tt></i>, GLint <i><tt>vn</tt></i>, GLdouble <i><tt>v1</tt></i>, GLdouble <i><tt>v2</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>glMapGrid2f</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLint <i><tt>un</tt></i>, GLfloat <i><tt>u1</tt></i>, GLfloat <i><tt>u2</tt></i>, GLint <i><tt>vn</tt></i>, GLfloat <i><tt>v1</tt></i>, GLfloat <i><tt>v2</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glMapGrid.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glMapGrid1d</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>un</tt></i>, <i><tt>u1</tt></i>, <i><tt>u2</tt></i>) &#8594; <tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>glMapGrid1f</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>un</tt></i>, <i><tt>u1</tt></i>, <i><tt>u2</tt></i>) &#8594; <tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>glMapGrid2d</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>un</tt></i>, <i><tt>u1</tt></i>, <i><tt>u2</tt></i>, <i><tt>vn</tt></i>, <i><tt>v1</tt></i>, <i><tt>v2</tt></i>) &#8594; <tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>glMapGrid2f</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>un</tt></i>, <i><tt>u1</tt></i>, <i><tt>u2</tt></i>, <i><tt>vn</tt></i>, <i><tt>v1</tt></i>, <i><tt>v2</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glMapGrid.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>un</tt></i></span></dt><dd>
						Specifies the number of partitions in the grid range interval [<i><tt>u1</tt></i>,
						<i><tt>u2</tt></i>]. Must be positive.
					</dd><dt><span class="term"><i><tt>u1</tt></i>, <i><tt>u2</tt></i></span></dt><dd>
						Specify the mappings for integer grid domain values <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mrow>
									<mml:mi>i</mml:mi>
									<mml:mo>=</mml:mo>
									<mml:mn>0</mml:mn>
								</mml:mrow>
							</mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mrow>
									<mml:mi>i</mml:mi>
									<mml:mo>=</mml:mo>
									<mml:mi>un</mml:mi>
								</mml:mrow>
							</mml:math>.
					</dd><dt><span class="term"><i><tt>vn</tt></i></span></dt><dd>
						Specifies the number of partitions in the grid range interval [<i><tt>v1</tt></i>,
						<i><tt>v2</tt></i>]
					</dd></dl></div><p>
			(<tt>glMapGrid2</tt> only).
		</p><div class="variablelist"><dl><dt><span class="term"><i><tt>v1</tt></i>, <i><tt>v2</tt></i></span></dt><dd>
						Specify the mappings for integer grid domain values <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mrow>
									<mml:mi>j</mml:mi>
									<mml:mo>=</mml:mo>
									<mml:mn>0</mml:mn>
								</mml:mrow>
							</mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mrow>
									<mml:mi>j</mml:mi>
									<mml:mo>=</mml:mo>
									<mml:mi>vn</mml:mi>
								</mml:mrow>
							</mml:math>
					</dd></dl></div><p>
			(<tt>glMapGrid2</tt> only).
		</p></div><div class="refsect1" lang="en"><a name="glMapGrid.3G-description"/><h2>Description</h2><p>
			<tt>glMapGrid</tt> and <tt>glEvalMesh</tt> are used
			together to efficiently generate and evaluate a series of evenly-spaced map domain values. <tt>glEvalMesh</tt> steps through the integer domain of a one- or two-dimensional grid, whose
			range is the domain of the evaluation maps specified by <tt>glMap1</tt> and <tt>glMap2</tt>.
		</p><p>
			<tt>glMapGrid1</tt> and <tt>glMapGrid2</tt> specify the
			linear grid mappings between the <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>i</mml:mi>
				</mml:math> (or <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>i</mml:mi>
				</mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>j</mml:mi>
				</mml:math>) integer grid coordinates, to the <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>u</mml:mi>
				</mml:math> (or <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>u</mml:mi>
				</mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>v</mml:mi>
				</mml:math>) floating-point evaluation map coordinates. See <tt>glMap1</tt> and
			<tt>glMap2</tt> for details of how <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>u</mml:mi>
				</mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>v</mml:mi>
				</mml:math> coordinates are evaluated.
		</p><p>
			<tt>glMapGrid1</tt> specifies a single linear mapping such that integer grid coordinate
			0 maps exactly to <i><tt>u1</tt></i>, and integer grid coordinate <i><tt>un</tt></i> maps exactly to
			<i><tt>u2</tt></i>. All other integer grid coordinates <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>i</mml:mi>
				</mml:math> are mapped so that </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
					<mml:mrow>
						<mml:mi>u</mml:mi>
						<mml:mo>=</mml:mo>
						<mml:mi>i</mml:mi>
						<mml:mo>(</mml:mo>
						<mml:mi>u2</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mi>u1</mml:mi>
						<mml:mo>)</mml:mo>
						<mml:mo>/</mml:mo>
						<mml:mi>un</mml:mi>
						<mml:mo>+</mml:mo>
						<mml:mi>u1</mml:mi>
					</mml:mrow>
				</mml:math></div><p><tt>glMapGrid2</tt> specifies two such linear mappings. One maps
			integer grid coordinate <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>i</mml:mi>
						<mml:mo>=</mml:mo>
						<mml:mn>0</mml:mn>
					</mml:mrow>
				</mml:math> exactly to <i><tt>u1</tt></i>, and integer grid coordinate <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>i</mml:mi>
						<mml:mo>=</mml:mo>
						<mml:mi>un</mml:mi>
					</mml:mrow>
				</mml:math> exactly to <i><tt>u2</tt></i>. The other maps integer grid coordinate <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>j</mml:mi>
						<mml:mo>=</mml:mo>
						<mml:mn>0</mml:mn>
					</mml:mrow>
				</mml:math> exactly to <i><tt>v1</tt></i>, and integer grid coordinate <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>j</mml:mi>
						<mml:mo>=</mml:mo>
						<mml:mi>vn</mml:mi>
					</mml:mrow>
				</mml:math> exactly to <i><tt>v2</tt></i>. Other integer grid coordinates <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>i</mml:mi>
				</mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>j</mml:mi>
				</mml:math> are mapped such that
		</p><p>
			</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
					<mml:mrow>
						<mml:mi>u</mml:mi>
						<mml:mo>=</mml:mo>
						<mml:mi>i</mml:mi>
						<mml:mo>(</mml:mo>
						<mml:mi>u2</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mi>u1</mml:mi>
						<mml:mo>)</mml:mo>
						<mml:mo>/</mml:mo>
						<mml:mi>un</mml:mi>
						<mml:mo>+</mml:mo>
						<mml:mi>u1</mml:mi>
					</mml:mrow>
				</mml:math></div><p>
		</p><p>
			</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
					<mml:mrow>
						<mml:mi>v</mml:mi>
						<mml:mo>=</mml:mo>
						<mml:mi>j</mml:mi>
						<mml:mo>(</mml:mo>
						<mml:mi>v2</mml:mi>
						<mml:mo>-</mml:mo>
						<mml:mi>v1</mml:mi>
						<mml:mo>)</mml:mo>
						<mml:mo>/</mml:mo>
						<mml:mi>vn</mml:mi>
						<mml:mo>+</mml:mo>
						<mml:mi>v1</mml:mi>
					</mml:mrow>
				</mml:math></div><p>
		</p><p>
			The mappings specified by <tt>glMapGrid</tt> are used identically by <tt>glEvalMesh</tt> and <tt>glEvalPoint</tt>.
		</p></div><div class="refsect1" lang="en"><a name="glMapGrid.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_VALUE</tt> is generated if either <i><tt>un</tt></i> or <i><tt>vn</tt></i> is
			not positive.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glMapGrid</tt> is
			executed between the execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of
			<a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p></div><div class="refsect1" lang="en"><a name="glMapGrid.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGet</tt> with argument <tt>GL_MAP1_GRID_DOMAIN</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_MAP2_GRID_DOMAIN</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_MAP1_GRID_SEGMENTS</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_MAP2_GRID_SEGMENTS</tt>
		</p></div><div class="refsect1" lang="en"><a name="glMapGrid.3G-see_also"/><h2>See Also</h2><p>
			<tt>glEvalCoord</tt>, <tt>glEvalMesh</tt>, <tt>glEvalPoint</tt>, <tt>glMap1</tt>, <tt>glMap2</tt>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glMap2.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glMaterial.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glMap2 </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glMaterial</td></tr></table></div></body></html>