<?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>glLoadMatrix</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.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glLoadIdentity.3G.xml" title="glLoadIdentity"/><link rel="next" href="glLoadName.3G.xml" title="glLoadName"/></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">glLoadMatrix</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glLoadIdentity.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glLoadName.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glLoadMatrix.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glLoadMatrix.3G-name"/><h2>Name</h2><p>glLoadMatrixd, glLoadMatrixf &#8212; replace the current matrix with the specified matrix</p></div><div class="refsynopsisdiv"><a name="glLoadMatrix.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glLoadMatrixd</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>const GLdouble *<i><tt>m</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>glLoadMatrixf</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>const GLfloat *<i><tt>m</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glLoadMatrix.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glLoadMatrixd</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>m</tt></i>) &#8594; <tt>None</tt></code></td></tr><tr><td valign="top"><code><tt>glLoadMatrixf</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>m</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glLoadMatrix.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>m</tt></i></span></dt><dd>
						Specifies a pointer to 16 consecutive values, which are used as the elements of a <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mrow>
									<mml:mn>4</mml:mn>
									<mml:mo>×</mml:mo>
									<mml:mn>4</mml:mn>
								</mml:mrow>
							</mml:math> column-major matrix.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glLoadMatrix.3G-description"/><h2>Description</h2><p>
			<tt>glLoadMatrix</tt> replaces the current matrix with the one whose elements are
			specified by <i><tt>m</tt></i>. The current matrix is the projection matrix, modelview matrix, or texture
			matrix, depending on the current matrix mode (see <a href="glMatrixMode.3G.xml">glMatrixMode</a>).
		</p><p>
			The current matrix, M, defines a transformation of coordinates. For instance, assume M refers to the modelview matrix.
			If <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
						<mml:mi>v</mml:mi>
						<mml:mo>=</mml:mo>
						<mml:mfenced separator=",">
							<mml:mrow>
								<mml:mi>v</mml:mi>
								<mml:mfenced separator="," open="[" close="]">
									<mml:mn>0</mml:mn>
								</mml:mfenced>
							</mml:mrow>
							<mml:mrow>
								<mml:mi>v</mml:mi>
								<mml:mfenced separator="," open="[" close="]">
								<mml:mn>1</mml:mn>
								</mml:mfenced>
							</mml:mrow>
							<mml:mrow>
								<mml:mi>v</mml:mi>
								<mml:mfenced separator="," open="[" close="]">
								<mml:mn>2</mml:mn>
								</mml:mfenced>
							</mml:mrow>
							<mml:mrow>
								<mml:mi>v</mml:mi>
								<mml:mfenced separator="," open="[" close="]">
								<mml:mn>3</mml:mn>
								</mml:mfenced>
							</mml:mrow>
						</mml:mfenced>
				</mml:math> is the set of object coordinates of a vertex, and <i><tt>m</tt></i> points to an array of
			<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mn>16</mml:mn>
				</mml:math> single- or double-precision floating-point values <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mfenced separator="," open="" close="">
							<mml:mrow>
							<mml:mi>m</mml:mi>
							<mml:mfenced separator="," open="[" close="]">
							<mml:mn>0</mml:mn>
							</mml:mfenced>
							</mml:mrow>
							<mml:mrow>
							<mml:mi>m</mml:mi>
							<mml:mfenced separator="," open="[" close="]">
							<mml:mn>1</mml:mn>
							</mml:mfenced>
							</mml:mrow>
							&#8230;
							<mml:mrow>
							<mml:mi>m</mml:mi>
							<mml:mfenced separator="," open="[" close="]">
							<mml:mn>15</mml:mn>
							</mml:mfenced>
							</mml:mrow>
					</mml:mfenced>
				</mml:math>, then the modelview transformation <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mrow>
						<mml:mi>M</mml:mi>
						<mml:mfenced separator=",">
						<mml:mi>v</mml:mi>
						</mml:mfenced>
					</mml:mrow>
				</mml:math> does the following:
		</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>M</mml:mi>
						<mml:mfenced separator=",">
						<mml:mi>v</mml:mi>
						</mml:mfenced>
						<mml:mo>=</mml:mo>
								<mml:mfenced separator=",">
								<mml:mtable>
									<mml:mtr>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>0</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>4</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>8</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>12</mml:mn>
											</mml:mfenced>
										</mml:mtd>
									</mml:mtr>
									<mml:mtr>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>1</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>5</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>9</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>13</mml:mn>
											</mml:mfenced>
										</mml:mtd>
									</mml:mtr>
									<mml:mtr>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>2</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>6</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>10</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>14</mml:mn>
											</mml:mfenced>
										</mml:mtd>
									</mml:mtr>
									<mml:mtr>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>3</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>7</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>11</mml:mn>
											</mml:mfenced>
										</mml:mtd>
										<mml:mtd columnalign="center">
											<mml:mi>m</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>15</mml:mn>
											</mml:mfenced>
										</mml:mtd>
									</mml:mtr>
								</mml:mtable>
								</mml:mfenced>
							<mml:mo>×</mml:mo>
								<mml:mfenced separator=",">
								<mml:mtable>
									<mml:mtr>
										<mml:mtd columnalign="center">
											<mml:mi>v</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>0</mml:mn>
											</mml:mfenced>
										</mml:mtd>
									</mml:mtr>
									<mml:mtr>
										<mml:mtd columnalign="center">
											<mml:mi>v</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>1</mml:mn>
											</mml:mfenced>
										</mml:mtd>
									</mml:mtr>
									<mml:mtr>
										<mml:mtd columnalign="center">
											<mml:mi>v</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>2</mml:mn>
											</mml:mfenced>
										</mml:mtd>
									</mml:mtr>
									<mml:mtr>
										<mml:mtd columnalign="center">
											<mml:mi>v</mml:mi>
											<mml:mfenced separator="," open="[" close="]">
											<mml:mn>3</mml:mn>
											</mml:mfenced>
										</mml:mtd>
									</mml:mtr>
								</mml:mtable>
								</mml:mfenced>
					</mml:mrow>
				</mml:math></div><p>
		</p><p>
			Where "<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mo>×</mml:mo>
				</mml:math>" denotes matrix multiplication.
		</p><p>
			Projection and texture transformations are similarly defined.
		</p></div><div class="refsect1" lang="en"><a name="glLoadMatrix.3G-notes"/><h2>Notes</h2><p>
			While the elements of the matrix may be specified with single or double precision, the GL implementation may store or
			operate on these values in less than single precision.
		</p></div><div class="refsect1" lang="en"><a name="glLoadMatrix.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glLoadMatrix</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="glLoadMatrix.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGet</tt> with argument <tt>GL_MATRIX_MODE</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_COLOR_MATRIX</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_MODELVIEW_MATRIX</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_PROJECTION_MATRIX</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_TEXTURE_MATRIX</tt>
		</p></div><div class="refsect1" lang="en"><a name="glLoadMatrix.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glLoadIdentity.3G.xml">glLoadIdentity</a>, <a href="glMatrixMode.3G.xml">glMatrixMode</a>, <a href="glMultMatrix.3G.xml">glMultMatrix</a>, <a href="glPushMatrix.3G.xml">glPushMatrix</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glLoadIdentity.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="glLoadName.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glLoadIdentity </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glLoadName</td></tr></table></div></body></html>
