ReactOS  0.4.15-dev-1200-gc3b3fcd
xform.h
Go to the documentation of this file.
1 /* $Id: xform.h,v 1.4 1997/04/02 03:15:02 brianp Exp $ */
2 
3 /*
4  * Mesa 3-D graphics library
5  * Version: 2.0
6  * Copyright (C) 1995-1996 Brian Paul
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22 
23 
24 /*
25  * $Log: xform.h,v $
26  * Revision 1.4 1997/04/02 03:15:02 brianp
27  * removed gl_xform_texcoords_4fv()
28  *
29  * Revision 1.3 1996/11/08 02:20:39 brianp
30  * added gl_xform_texcoords_4fv()
31  *
32  * Revision 1.2 1996/11/04 01:39:46 brianp
33  * removed MAP_X(), MAP_Y() and MAP_Z() macros
34  *
35  * Revision 1.1 1996/09/13 01:38:16 brianp
36  * Initial revision
37  *
38  */
39 
40 
41 #ifndef XFORM_H
42 #define XFORM_H
43 
44 
45 #include "types.h"
46 
47 
48 /*
49  * Transform a point (column vector) by a matrix: Q = M * P
50  */
51 #define TRANSFORM_POINT( Q, M, P ) \
52  Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; \
53  Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; \
54  Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; \
55  Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3];
56 
57 
58 /*
59  * Transform a normal (row vector) by a matrix: [NX NY NZ] = N * MAT
60  */
61 #define TRANSFORM_NORMAL( NX, NY, NZ, N, MAT ) \
62  NX = N[0] * MAT[0] + N[1] * MAT[1] + N[2] * MAT[2]; \
63  NY = N[0] * MAT[4] + N[1] * MAT[5] + N[2] * MAT[6]; \
64  NZ = N[0] * MAT[8] + N[1] * MAT[9] + N[2] * MAT[10]; \
65 
66 
67 
68 extern void gl_xform_points_4fv( GLuint n, GLfloat q[][4], const GLfloat m[16],
69  GLfloat p[][4] );
70 
71 
72 extern void gl_xform_points_3fv( GLuint n, GLfloat q[][4], const GLfloat m[16],
73  GLfloat p[][3] );
74 
75 
76 extern void gl_xform_normals_3fv( GLuint n, GLfloat v[][3],
77  const GLfloat m[16],
78  GLfloat u[][3], GLboolean normalize );
79 
80 
81 extern void gl_transform_vector( GLfloat u[4],
82  const GLfloat v[4], const GLfloat m[16] );
83 
84 
85 #endif
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
Definition: glfuncs.h:240
void gl_xform_points_4fv(GLuint n, GLfloat q[][4], const GLfloat m[16], GLfloat p[][4])
Definition: xform.c:88
static void normalize(float vec[3])
Definition: bezierEval.cc:234
GLdouble n
Definition: glext.h:7729
void gl_xform_points_3fv(GLuint n, GLfloat q[][4], const GLfloat m[16], GLfloat p[][3])
Definition: xform.c:145
const GLfloat * m
Definition: glext.h:10848
unsigned char GLboolean
Definition: gl.h:151
void gl_transform_vector(GLfloat u[4], const GLfloat v[4], const GLfloat m[16])
Definition: xform.c:248
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
void gl_xform_normals_3fv(GLuint n, GLfloat v[][3], const GLfloat m[16], GLfloat u[][3], GLboolean normalize)
Definition: xform.c:195
const GLdouble * v
Definition: gl.h:2040
unsigned int GLuint
Definition: gl.h:159
float GLfloat
Definition: gl.h:161
GLfloat GLfloat p
Definition: glext.h:8902