- Main Page
- Namespaces
- Classes
- Files

# VCRA-SZCZERBACKI-PointBasedRendering/ssMatrixFactory.cpp

    00001
    00002 #include "ssMatrix.hpp"
    00003
    00004 using namespace SS;
    00005
    00006
    00007 Matrix4x4 MatrixFactory::rotateX        (float angle)
    00008 {
    00009         float s = (float)::sin(angle);
    00010         float c = (float)::cos(angle);
    00011         float o = 1.f;
    00012         float z = 0.f;
    00013
    00014         Matrix4x4       m;      //calls ident()
    00015         m.setColumn(0,Vector4(o, z, z, 0));
    00016         m.setColumn(1,Vector4(z, c,-s, 0));
    00017         m.setColumn(2,Vector4(z, s, c ,0));
    00018
    00019         return m;
    00020 }
    00021
    00022
    00023 Matrix4x4 MatrixFactory::rotateY        (float angle)
    00024 {
    00025         float s = (float)::sin(angle);
    00026         float c = (float)::cos(angle);
    00027         float o = 1.f;
    00028         float z = 0.f;
    00029
    00030         Matrix4x4       m;      //calls ident()
    00031         m.setColumn(0,Vector4(c, z, s, 0));
    00032         m.setColumn(1,Vector4(z, o, z, 0));
    00033         m.setColumn(2,Vector4(-s,z, c ,0));
    00034
    00035         return m;
    00036 }
    00037
    00038
    00039 Matrix4x4 MatrixFactory::rotateZ        (float angle)
    00040 {
    00041         float s = (float)::sin(angle);
    00042         float c = (float)::cos(angle);
    00043         float o = 1.f;
    00044         float z = 0.f;
    00045
    00046         Matrix4x4       m;      //calls ident()
    00047         m.setColumn(0,Vector4(c,-s, z, 0));
    00048         m.setColumn(1,Vector4(s, c, z, 0));
    00049         m.setColumn(2,Vector4(z, z, o, 0));
    00050
    00051         return m;
    00052 }