⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scene.h

📁 visual c++ 实例编程
💻 H
字号:
// Scene.h: interface for the CScene class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SCENE_H__7E21CB2E_BCBC_4A3C_B2F2_4960D124B461__INCLUDED_)
#define AFX_SCENE_H__7E21CB2E_BCBC_4A3C_B2F2_4960D124B461__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define MAT_WORLD	0
#define MAT_VIEW	1
#define MAT_PROJ	2

#define AXIS_X		3
#define AXIS_Y		4
#define AXIS_Z		5

typedef struct _Matrix
{
	float _a11,_a12,_a13,_a14;
	float _a21,_a22,_a23,_a24;
	float _a31,_a32,_a33,_a34;
	float _a41,_a42,_a43,_a44;
} Matrix;

typedef struct _Vert3
{
	float x;
	float y;
	float z;
	float w;
} Vert3;

class CScene  
{
public:
	Matrix	*SetProjection(Matrix * projmat,float nearclip,float farclip,float fov);
	Vert3	*ChaMult(Vert3 * vertout,Vert3 * vertu,Vert3 * vertv);
	float	DianMult(Vert3 * vertin1,Vert3 * vertin2);
	Matrix	*SetViewLookAt(Matrix * matView,Vert3 * vlookat,Vert3 * vEye,Vert3 * updir);
	
	CScene();
	virtual ~CScene();
	
	int		SetMatrix(int matkind,Matrix * mat);
	Matrix	*MultMatrix(Matrix * outmat,Matrix * inmat1,Matrix * inmat2);
	void	DrawPrimtive(HDC hdc,int nVertex,Vert3 * vertexbuf);
	Matrix	*IdentifyMatrix(Matrix * mat);
	Matrix	*MatRotation(Matrix * mat,float alpha,int axis);
	Matrix	*MatTranslation(Matrix * mat,float xoffset,float yoffset,float zoffset);
	
protected:
	void	MultVertWithMatrix(Vert3 * vertout,Vert3 * vertin,Matrix * mat);
	Matrix	m_WorldMatrix,m_ViewMatrix,m_ProjMatrix;
	
};

#endif // !defined(AFX_SCENE_H__7E21CB2E_BCBC_4A3C_B2F2_4960D124B461__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -