1 // Copyright (c) 2011 The Native Client Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef EXAMPLES_TUMBLER_TRANSFORMS_H_
6 #define EXAMPLES_TUMBLER_TRANSFORMS_H_
10 // A very simple set of 4x4 matrix routines. In all these routines, the input
11 // matrix is assumed to be a 4x4 of GLfloats.
13 namespace transform_4x4 {
15 // Pre-multply |m| with a projection transformation 4x4 matrix from a
16 // truncated pyramid viewing frustum.
17 void Frustum(GLfloat* m,
25 // Replace |m| with the 4x4 identity matrix.
26 void LoadIdentity(GLfloat* m);
28 // |m| <- |a| . |b|. |m| can point at the same memory as either |a| or |b|.
29 void Multiply(GLfloat *m, GLfloat *a, GLfloat* b);
31 // Pre-multiply |m| with a single-point perspective matrix based on the viewing
32 // frustum whose view angle is |fovy|.
33 void Perspective(GLfloat* m,
39 // Pre-multiply |m| with a matrix that represents a translation by |tx|, |ty|,
41 void Translate(GLfloat* m, GLfloat tx, GLfloat ty, GLfloat tz);
42 } // namespace transform_4x4
44 #endif // EXAMPLES_TUMBLER_TRANSFORMS_H_