Скачиваний:
25
Добавлен:
01.05.2014
Размер:
1.61 Кб
Скачать

/*
File: Matrix.h
Author: Thomas Mшlhave (AKA Thoooms)
Info: This file contains the prototypes and so on for my matrix class

*/
#ifndef __MAT4X4_H_INCLUDED__
#define __MAT4X4_H_INCLUDED__

const float TM_PI = 3.141592654f;
const float TM_PI_DIV_180 = TM_PI/180.0f;

class Matrix4x4
{
private:
public:
	float M[4][4];	//should be made private
	void	InsertVertex	(unsigned int row, unsigned int col, float* num);
	float		GetElement				(unsigned int row, unsigned int column);
	void ZeroOutMatrix			(void);
	void MultiplyWithScalar(float num);
	void MakeIdentityMatrix_4x4	(void);
	Matrix4x4 MultiplyWith4x4(Matrix4x4* a);
};

class Matrix4x1
{
private:

public:

	/* To avoid the below temp vars I should derive a "point" class" */
	int			params;	//temp! Needed for compatibility with 3dclass
	bool		active; //temp! Needed for compatibility with 3dclass

	float		M[4]; //should be made private

	Matrix4x1();		//standard constructor
	Matrix4x1(float x, float y, float z, float w);	//constructor that uses values
	void		InsertVertex	(unsigned int row, float* num);
	Matrix4x1	MultiplyWith4x4	(Matrix4x4 *a);
	void		DivideWith_W	(void);
	void		ProjectPerspective(float distance_from_screen);	// returns the projektet coordinate
	void		Translate(float dx, float dy, float dz);
	void		Scale(float sx, float sy, float sz);
	float		GetLenght();
	void MultiplyWithScalar(float num);
	Matrix4x1   CrossProduct(Matrix4x1* a);
	Matrix4x1	XRotate(float Angle);
	Matrix4x1	YRotate(float Angle);
	Matrix4x1	ZRotate(float Angle);
};

#endif __MAT4X4_H_INCLUDED__    
Соседние файлы в папке bezier
  • #
    01.05.2014533 б25main.dsw
  • #
    01.05.201450.18 Кб25main.ncb
  • #
    01.05.201448.64 Кб25main.opt
  • #
    01.05.2014242 б26main.plg
  • #
    01.05.20145.25 Кб26Matrix.cpp
  • #
    01.05.20141.61 Кб25Matrix.h