04 2012 档案

ogre天空和雾
摘要:mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox"); //设置天空盒mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5.0f, 8.0f); //设置天空穹Plane plane;plane.d = 1000.0f;plane.normal = Vector3::NEGATIVE_UNIT_Y;mSceneMgr->setSkyPlane(true, plane, "Examples/CloudySky", 1500 阅读全文

posted @ 2012-04-30 23:34 紫澜 阅读(584) 评论(0) 推荐(0)

ogre阴影
摘要:开启阴影技术:mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);某个实体开启和关闭阴影:ent->setCastShadows(false);创建灯光:每个灯光产生一个阴影Light* light = mSceneMgr->createLight("Light1");light->setType(Light::LT_POINT);light->setPosition(Vector3(0.0f, 150.0f, 250.0f));light->setDiffuseColou 阅读全文

posted @ 2012-04-30 22:28 紫澜 阅读(752) 评论(0) 推荐(0)

ogre_机器人在10个位置循环走动
摘要:#include <ExampleApplication.h>#include <vector>#include <stdlib.h>#include <stdio.h>using namespace std;class MoveDemoListener : public ExampleFrameListener{protected:Vector3 mDirection;Vector3 mPosition;Real mMove;Real mDistance;Real mTime;AnimationState* mAnimationState;En 阅读全文

posted @ 2012-04-30 17:05 紫澜 阅读(698) 评论(0) 推荐(1)

ogre自动档初始化
摘要:#include <stdio.h>#include <ogre.h>using namespace Ogre;class MyLogListener:public LogListener{public:void messageLogged( const String& message, LogMessageLevel lml, bool maskDebug, const String &logName ){}};class MyFrameListener:public FrameListener{public:bool frameStarted(con 阅读全文

posted @ 2012-04-27 19:31 紫澜 阅读(182) 评论(0) 推荐(0)

mp3_CSound和CMusic类_转
摘要:#ifndef __MP3H__#define __MP3H__#define _AFXDLL#include <afx.h>#include <mmsystem.h>#include <mixerocx.h>class CSound {long m_device;MIXERCONTROL m_volCtrl;private:bool CSound::GetDevice(int dev,HMIXER &hmixer);public:CSound();virtual ~CSound();bool GetVolumeControl(HMIXER hmix 阅读全文

posted @ 2012-04-26 14:36 紫澜 阅读(741) 评论(0) 推荐(0)

文件监视_能用_但似乎不太完善
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>#include <Windows.h>#include <ShellAPI.h>#include <ShlObj.h>#include <ShTypes.h>#define WM_USERDEF_FILECHANGED 0x1000LRESULT CALLBACK WindowProc(HWND hWnd, int uMsg, WPARAM wParam, LPARAM lParam){switch 阅读全文

posted @ 2012-04-25 20:37 紫澜 阅读(520) 评论(0) 推荐(0)

CSound类源文件
摘要:#ifndef __SoundH__#define __SoundH__#include <dsound.h>#include "SDKwavefile.h"#include <vector>using namespace std;struct SSound{IDirectSoundBuffer8* pSoundBuffer;bool bLooping;SSound() { pSoundBuffer = 0; bLooping = false; }};class CSound{private:IDirectSound8* m_pSound;vecto 阅读全文

posted @ 2012-04-23 17:53 紫澜 阅读(1020) 评论(0) 推荐(0)

使用DSound播放声音
摘要:HWND g_hWnd;IDirectSound8* g_pSound;IDirectSoundBuffer8* g_pSBuffer;CWaveFile* g_pWaveFile;DirectSoundCreate8(0, &g_pSound, 0);g_pSound->SetCooperativeLevel(g_hWnd, DSSCL_PRIORITY);g_pWaveFile = new CWaveFile;ZeroMemory(g_pWaveFile, sizeof(CWaveFile));HRESULT hr;hr = g_pWaveFile->Open(L&qu 阅读全文

posted @ 2012-04-23 16:53 紫澜 阅读(1705) 评论(0) 推荐(0)

简单播放声音PlaySound
摘要:播放一次 PlaySoundA("test.wav", NULL, SND_FILENAME | SND_ASYNC);连续播放 PlaySoundA("test.wav", NULL, SND_FILENAME | SND_ASYNC | SND_LOOP);PlaySound的使用需要<mmsystem.h>和"winmm.lib" 阅读全文

posted @ 2012-04-23 16:10 紫澜 阅读(380) 评论(0) 推荐(0)

X文件的动画类及基本使用方法
摘要:------------------------------Animation.h--------------------------------------没有Animation.cpp-----------#ifndef __AnimationH__#define __AnimationH__#include <d3d9.h>#include <d3dx9.h>//struct D3DXFRAME_DERIVED & D3DXMESHCONTAINER_DERIVEDstruct D3DXFRAME_DERIVED : public D3DXFRAME{D3 阅读全文

posted @ 2012-04-23 12:34 紫澜 阅读(895) 评论(0) 推荐(0)

1366X768成为全球最流行屏幕分辨率
摘要:1366X768 2048x1536 1024x768 1280x800 阅读全文

posted @ 2012-04-23 10:32 紫澜 阅读(231) 评论(0) 推荐(0)

Vertex Shader And Pixel Shader
摘要:顶点渲染管线(Vertex Shader)与像素渲染管线(Pixel Shader)是决定显卡性能的决定性因素,由于这两个渲染管线的设计都被标准化,nVIDIA和ATI只能通过增加其数量来达到快速提升性能的目的。顶点渲染单元(Vertex Shader)负责生成3D图像的骨架,三角形的每个顶点信息都是由它计算完成。相对像素渲染,顶点渲染的工作量要轻得多,但它承担了3D运算的基础工作,对GPU的最终效能有着决定性的影响。像素渲染(Pixel Shader)是3D处理中最关键的工作,大家在游戏中看到的大量水面波纹、反光、凹凸质感、旗帜飘扬之类的特效都是由它处理,任务量最为繁重、对性能的影响也最大。 阅读全文

posted @ 2012-04-23 09:36 紫澜 阅读(1023) 评论(0) 推荐(0)

使用DXUT时需要附加的依赖项
摘要:version.lib;imm32.lib;comctl32.lib;d3dx10d.lib;d3dx9d.lib;dxerr.lib;dxguid.lib;winmm.lib;dsound.lib不一定全部要,但加了这些可以用 阅读全文

posted @ 2012-04-23 09:14 紫澜 阅读(161) 评论(0) 推荐(0)

高精度定时
摘要:BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency);BOOL QueryPerformanceCounter (LARGE_INTEGER *lpCount); 阅读全文

posted @ 2012-04-22 22:51 紫澜 阅读(122) 评论(0) 推荐(0)