#include <math.h>
#include "mmath.h"
#include "types.h"
#include "xform.h"
Go to the source code of this file.
|
void | gl_xform_points_4fv (GLuint n, GLfloat q[][4], const GLfloat m[16], GLfloat p[][4]) |
|
void | gl_xform_points_3fv (GLuint n, GLfloat q[][4], const GLfloat m[16], GLfloat p[][3]) |
|
void | gl_xform_normals_3fv (GLuint n, GLfloat v[][3], const GLfloat m[16], GLfloat u[][3], GLboolean normalize) |
|
void | gl_transform_vector (GLfloat u[4], const GLfloat v[4], const GLfloat m[16]) |
|
◆ gl_transform_vector()
Definition at line 248 of file xform.c.
249{
251#define M(row,col) m[col*4+row]
252 u[0] =
v0 *
M(0,0) +
v1 *
M(1,0) +
v2 *
M(2,0) +
v3 *
M(3,0);
253 u[1] =
v0 *
M(0,1) +
v1 *
M(1,1) +
v2 *
M(2,1) +
v3 *
M(3,1);
254 u[2] =
v0 *
M(0,2) +
v1 *
M(1,2) +
v2 *
M(2,2) +
v3 *
M(3,2);
255 u[3] =
v0 *
M(0,3) +
v1 *
M(1,3) +
v2 *
M(2,3) +
v3 *
M(3,3);
256#undef M
257}
GLfloat GLfloat GLfloat GLfloat v3
GLfloat GLfloat GLfloat v2
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Referenced by gl_ClipPlane(), gl_Lightfv(), and gl_TexGenfv().
◆ gl_xform_normals_3fv()
Definition at line 195 of file xform.c.
197{
199
206 {
208 tx = ux * m0 + uy * m1 + uz * m2;
209 ty = ux * m4 + uy * m5 + uz * m6;
210 tz = ux * m8 + uy * m9 + uz * m10;
211 }
212 {
219 }
220 }
221 }
222 else {
223
230 v[
i][0] = ux * m0 + uy * m1 + uz * m2;
231 v[
i][1] = ux * m4 + uy * m5 + uz * m6;
232 v[
i][2] = ux * m8 + uy * m9 + uz * m10;
233 }
234 }
235}
static void normalize(float vec[3])
GLenum GLenum GLenum GLenum GLenum scale
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by gl_DrawArrays(), and gl_transform_vb_part1().
◆ gl_xform_points_3fv()
Definition at line 145 of file xform.c.
147{
148
149
150
151
152 {
158 q[
i][0] = m0 * p0 + m4 * p1 + m8 * p2 +
m12;
159 q[
i][1] = m1 * p0 + m5 * p1 + m9 * p2 +
m13;
160 }
161 }
162 {
166 if (m3==0.0F && m7==0.0F &&
m11==0.0F && m15==1.0F) {
167
170 q[
i][2] = m2 * p0 + m6 * p1 + m10 * p2 +
m14;
172 }
173 }
174 else {
175
178 q[
i][2] = m2 * p0 + m6 * p1 + m10 * p2 +
m14;
179 q[
i][3] = m3 * p0 + m7 * p1 +
m11 * p2 + m15;
180 }
181 }
182 }
183}
GLdouble GLdouble GLdouble GLdouble q
Referenced by gl_DrawArrays().
◆ gl_xform_points_4fv()
Definition at line 88 of file xform.c.
90{
91
92
93
94
95 {
99 if (
m12==0.0F &&
m13==0.0F) {
100
103 q[
i][0] = m0 * p0 + m4 * p1 + m8 * p2;
104 q[
i][1] = m1 * p0 + m5 * p1 + m9 * p2;
105 }
106 }
107 else {
108
111 q[
i][0] = m0 * p0 + m4 * p1 + m8 * p2 +
m12 * p3;
112 q[
i][1] = m1 * p0 + m5 * p1 + m9 * p2 +
m13 * p3;
113 }
114 }
115 }
116 {
120 if (m3==0.0F && m7==0.0F &&
m11==0.0F && m15==1.0F) {
121
124 q[
i][2] = m2 * p0 + m6 * p1 + m10 * p2 +
m14 * p3;
126 }
127 }
128 else {
129
132 q[
i][2] = m2 * p0 + m6 * p1 + m10 * p2 +
m14 * p3;
133 q[
i][3] = m3 * p0 + m7 * p1 +
m11 * p2 + m15 * p3;
134 }
135 }
136 }
137}
Referenced by gl_DrawArrays().