Ogre中计算Tangent, 感觉很不错!
[ 2007-01-22 18:09:21 | 作者: Admin ]
Vector3 Math::calculateTangentSpaceVector(
const Vector3& position1, const Vector3& position2, const Vector3& position3,
Real u1, Real v1, Real u2, Real v2, Real u3, Real v3)
{
//side0 is the vector along one side of the triangle of vertices passed in,
//and side1 is the vector along another side. Taking the cross product of these returns the normal.
...const Vector3& position1, const Vector3& position2, const Vector3& position3,
Real u1, Real v1, Real u2, Real v2, Real u3, Real v3)
{
//side0 is the vector along one side of the triangle of vertices passed in,
//and side1 is the vector along another side. Taking the cross product of these returns the normal.
阅读全文...
如果转载请注明出处
http://www.azure.com.cn/
矩阵表示
[ A11 A12 A13 A14 ]
[ A21 A22 A23 A24 ]
[ A31 A32 A33 A34 ] / det(A)
[ A41 A42 A43 A44 ]
函数实现(假设我们已经实现了Matrix4类)
阅读全文...
http://www.azure.com.cn/
矩阵表示
[ A11 A12 A13 A14 ]
[ A21 A22 A23 A24 ]
[ A31 A32 A33 A34 ] / det(A)
[ A41 A42 A43 A44 ]
函数实现(假设我们已经实现了Matrix4类)
bool MatrixInvert(Matrix4& inv, Matrix4& source)
{
Matrix4 TempMat;
//检验原矩阵的有效性
if(fabs(a._44 - 1.0f) > 0.001f)
return false;
if(fabs(a._14)>0.001f || fabs(a._24)>0.001f || fabs(a._34)>0.001f)
...{
Matrix4 TempMat;
//检验原矩阵的有效性
if(fabs(a._44 - 1.0f) > 0.001f)
return false;
if(fabs(a._14)>0.001f || fabs(a._24)>0.001f || fabs(a._34)>0.001f)
阅读全文...
DirectX的替代品 SDL 简介
[ 2007-01-22 11:02:23 | 作者: Admin ]
什么是SDL?
即 Simple DirectMedia Layer,使用 LGPL 许可证。
免费的跨平台多媒体应用编程接口
用于游戏、游戏开发工具、模拟器、样本演示、多媒体应用等
它能做什么?
视频、音频、事件、CDROM支持、线程、计时器、各种图象文件格式读取、快速绘图、混音、游戏杆支持、网络、MPEG解码等等,且CPU字节顺序无关。
大体上与DirectX比较对应关系如下:
SDL_Video、SDL_Image、OpenGL —— DirectDraw、Direct3D
SDL_Audio、SDL_Mixer —— DirectSound
SDL_Joystick、SDL_Base —— DirectInput
SDL_Net —— DirectPlay
SMPEG、SDL_Video、SDL_Audio、SDL_Sound、SDL_Filter —— DirectShow
...
阅读全文...
即 Simple DirectMedia Layer,使用 LGPL 许可证。
免费的跨平台多媒体应用编程接口
用于游戏、游戏开发工具、模拟器、样本演示、多媒体应用等
它能做什么?
视频、音频、事件、CDROM支持、线程、计时器、各种图象文件格式读取、快速绘图、混音、游戏杆支持、网络、MPEG解码等等,且CPU字节顺序无关。
大体上与DirectX比较对应关系如下:
SDL_Video、SDL_Image、OpenGL —— DirectDraw、Direct3D
SDL_Audio、SDL_Mixer —— DirectSound
SDL_Joystick、SDL_Base —— DirectInput
SDL_Net —— DirectPlay
SMPEG、SDL_Video、SDL_Audio、SDL_Sound、SDL_Filter —— DirectShow
...
阅读全文...
1










