Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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="glTranslate"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glTranslate</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glTranslate</refname> | |
17 | <refpurpose>multiply the current matrix by a translation matrix</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glTranslated</function></funcdef> | |
23 | <paramdef>GLdouble <parameter>x</parameter></paramdef> | |
24 | <paramdef>GLdouble <parameter>y</parameter></paramdef> | |
25 | <paramdef>GLdouble <parameter>z</parameter></paramdef> | |
26 | </funcprototype> | |
27 | </funcsynopsis> | |
28 | <funcsynopsis> | |
29 | <funcprototype> | |
30 | <funcdef>void <function>glTranslatef</function></funcdef> | |
31 | <paramdef>GLfloat <parameter>x</parameter></paramdef> | |
32 | <paramdef>GLfloat <parameter>y</parameter></paramdef> | |
33 | <paramdef>GLfloat <parameter>z</parameter></paramdef> | |
34 | </funcprototype> | |
35 | </funcsynopsis> | |
36 | </refsynopsisdiv> | |
37 | <!-- eqn: ignoring delim $$ --> | |
38 | <refsect1 id="parameters"><title>Parameters</title> | |
39 | <variablelist> | |
40 | <varlistentry> | |
41 | <term><parameter>x</parameter></term> | |
42 | <term><parameter>y</parameter></term> | |
43 | <term><parameter>z</parameter></term> | |
44 | <listitem> | |
45 | <para> | |
46 | Specify the <emphasis>x</emphasis>, <emphasis>y</emphasis>, and <emphasis>z</emphasis> coordinates of a translation vector. | |
47 | </para> | |
48 | </listitem> | |
49 | </varlistentry> | |
50 | </variablelist> | |
51 | </refsect1> | |
52 | <refsect1 id="description"><title>Description</title> | |
53 | <para> | |
54 | <function>glTranslate</function> produces a translation by | |
55 | <inlineequation><mml:math> | |
56 | <!-- eqn: (x,y,z):--> | |
57 | <mml:mfenced open="(" close=")"> | |
58 | <mml:mi mathvariant="italic">x</mml:mi> | |
59 | <mml:mi mathvariant="italic">y</mml:mi> | |
60 | <mml:mi mathvariant="italic">z</mml:mi> | |
61 | </mml:mfenced> | |
62 | </mml:math></inlineequation>. | |
63 | The current matrix | |
64 | (see | |
65 | <citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>) | |
66 | is multiplied by this translation matrix, | |
67 | with the product replacing the current matrix, as if | |
68 | <citerefentry><refentrytitle>glMultMatrix</refentrytitle></citerefentry> were called with the following matrix | |
69 | for its argument: | |
70 | </para> | |
71 | <para> | |
72 | <informalequation><mml:math> | |
73 | <!-- eqn: left ( matrix { ccol { 1 above 0 above 0 above 0 } ccol { 0 above 1 above 0 above 0 } ccol { 0 above 0 above 1 above 0 } ccol { x above y above z above 1} } right ):--> | |
74 | <mml:mfenced open="(" close=")"> | |
75 | <mml:mtable> | |
76 | <mml:mtr> | |
77 | <mml:mtd> | |
78 | <mml:mn>1</mml:mn> | |
79 | </mml:mtd> | |
80 | <mml:mtd> | |
81 | <mml:mn>0</mml:mn> | |
82 | </mml:mtd> | |
83 | <mml:mtd> | |
84 | <mml:mn>0</mml:mn> | |
85 | </mml:mtd> | |
86 | <mml:mtd> | |
87 | <mml:mi mathvariant="italic">x</mml:mi> | |
88 | </mml:mtd> | |
89 | </mml:mtr> | |
90 | <mml:mtr> | |
91 | <mml:mtd> | |
92 | <mml:mn>0</mml:mn> | |
93 | </mml:mtd> | |
94 | <mml:mtd> | |
95 | <mml:mn>1</mml:mn> | |
96 | </mml:mtd> | |
97 | <mml:mtd> | |
98 | <mml:mn>0</mml:mn> | |
99 | </mml:mtd> | |
100 | <mml:mtd> | |
101 | <mml:mi mathvariant="italic">y</mml:mi> | |
102 | </mml:mtd> | |
103 | </mml:mtr> | |
104 | <mml:mtr> | |
105 | <mml:mtd> | |
106 | <mml:mn>0</mml:mn> | |
107 | </mml:mtd> | |
108 | <mml:mtd> | |
109 | <mml:mn>0</mml:mn> | |
110 | </mml:mtd> | |
111 | <mml:mtd> | |
112 | <mml:mn>1</mml:mn> | |
113 | </mml:mtd> | |
114 | <mml:mtd> | |
115 | <mml:mi mathvariant="italic">z</mml:mi> | |
116 | </mml:mtd> | |
117 | </mml:mtr> | |
118 | <mml:mtr> | |
119 | <mml:mtd> | |
120 | <mml:mn>0</mml:mn> | |
121 | </mml:mtd> | |
122 | <mml:mtd> | |
123 | <mml:mn>0</mml:mn> | |
124 | </mml:mtd> | |
125 | <mml:mtd> | |
126 | <mml:mn>0</mml:mn> | |
127 | </mml:mtd> | |
128 | <mml:mtd> | |
129 | <mml:mn>1</mml:mn> | |
130 | </mml:mtd> | |
131 | </mml:mtr> | |
132 | </mml:mtable> | |
133 | </mml:mfenced> | |
134 | </mml:math></informalequation> | |
135 | </para> | |
136 | <para> | |
137 | </para> | |
138 | <para> | |
139 | If the matrix mode is either <constant>GL_MODELVIEW</constant> or <constant>GL_PROJECTION</constant>, | |
140 | all objects drawn after a call to <function>glTranslate</function> are translated. | |
141 | </para> | |
142 | <para> | |
143 | Use <citerefentry><refentrytitle>glPushMatrix</refentrytitle></citerefentry> and | |
144 | <citerefentry><refentrytitle>glPopMatrix</refentrytitle></citerefentry> to save and restore | |
145 | the untranslated coordinate system. | |
146 | </para> | |
147 | </refsect1> | |
148 | <refsect1 id="errors"><title>Errors</title> | |
149 | <para> | |
150 | <constant>GL_INVALID_OPERATION</constant> is generated if <function>glTranslate</function> | |
151 | is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> | |
152 | and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
153 | </para> | |
154 | </refsect1> | |
155 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
156 | <para> | |
157 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MATRIX_MODE</constant> | |
158 | </para> | |
159 | <para> | |
160 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COLOR_MATRIX</constant> | |
161 | </para> | |
162 | <para> | |
163 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MODELVIEW_MATRIX</constant> | |
164 | </para> | |
165 | <para> | |
166 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PROJECTION_MATRIX</constant> | |
167 | </para> | |
168 | <para> | |
169 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_MATRIX</constant> | |
170 | </para> | |
171 | </refsect1> | |
172 | <refsect1 id="seealso"><title>See Also</title> | |
173 | <para> | |
174 | <citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>, | |
175 | <citerefentry><refentrytitle>glMultMatrix</refentrytitle></citerefentry>, | |
176 | <citerefentry><refentrytitle>glPushMatrix</refentrytitle></citerefentry>, | |
177 | <citerefentry><refentrytitle>glRotate</refentrytitle></citerefentry>, | |
178 | <citerefentry><refentrytitle>glScale</refentrytitle></citerefentry> | |
179 | </para> | |
180 | </refsect1> | |
181 | <refsect1 id="Copyright"><title>Copyright</title> | |
182 | <para> | |
183 | Copyright <trademark class="copyright"></trademark> 1991-2006 | |
184 | Silicon Graphics, Inc. This document is licensed under the SGI | |
185 | Free Software B License. For details, see | |
186 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. | |
187 | </para> | |
188 | </refsect1> | |
189 | </refentry> |