-
大小: 13KB文件类型: .zip金币: 2下载: 0 次发布日期: 2021-06-11
- 语言: 其他
- 标签: opengl math3d.c math3d.cpp
资源简介
opengl超级宝典中的例程所用到的math3d库,包括math3d.h和math3d.cpp

代码片段和文件信息
// math3d.cpp
// Math3D Library version 0.95
/* Copyright (c) 2007-2009 Richard S. Wright Jr.
All rights reserved.
Redistribution and use in source and binary forms with or without modification
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice this list
of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
Neither the name of Richard S. Wright Jr. nor the names of other contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS“ AND ANY
EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT
INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED
TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE DATA OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN
CONTRACT STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Implementation file for the Math3d library. The C-Runtime has math.h these routines
// are meant to suppliment math.h by adding geometry/math routines
// useful for graphics simulation and physics applications (3D stuff).
// This library is meant to be useful on Win32 Mac OS X various Linux/Unix distros
// and mobile platforms. Although designed with OpenGL in mind there are no OpenGL
// dependencies. Other than standard math routines the only other outside routine
// used is memcpy (for faster copying of vector arrays).
// Most of the library is inlined. Some functions however are here as I judged them
// too big to be inlined all over the place... nothing prevents anyone from changing
// this if it better fits their project requirements.
// Richard S. Wright Jr.
// Most functions are in-lined... and are defined here
#include “math3d.h“
////////////////////////////////////////////////////////////
// LoadIdentity
// For 3x3 and 4x4 float and double matricies.
// 3x3 float
void m3dLoadIdentity33(M3DMatrix33f m)
{
// Don‘t be fooled this is still column major
static M3DMatrix33f identity = { 1.0f 0.0f 0.0f
0.0f 1.0f 0.0f
0.0f 0.0f 1.0f };
memcpy(m identity sizeof(M3DMatrix33f));
}
// 3x3 double
void m3dLoadIdentity33(M3DMatrix33d m)
{
// Don‘t be fooled this is still column majo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 33392 2014-05-06 21:46 math3d\math3d.cpp
文件 29011 2014-05-06 21:46 math3d\math3d.h
目录 0 2014-05-19 15:50 math3d\
- 上一篇:ad603应用电路图
- 下一篇:汇编课设——一个win32计算器功能完整
相关资源
- OpenGL参考手册
- Qt Creator opengl实现四元数鼠标控制轨迹
- OpenGL文档,api大全,可直接查询函数
- opengl轮廓字体源代码
- MFC读三维模型obj文件
- 利用OpenGL写毛笔字算法
- MFC中OpenGL面和体的绘制以及动画效果
- 基于OPENGL的光线跟踪源代码368758
- VC 实现三维旋转(源码)
- 自编用openGL实现3D分形树,分形山
- OpenGL球形贴图自旋程序
- OpenGL导入贴图的Texture类
- 计算机图形学(openGL)代码
- 用OpenGL开发的机械臂运动仿真程序(
- OpenGL-3D坦克模拟
- OPENGL实现世界上最小的3D游戏
- VS2012OpenGL配置所需要的全部libdllh文件
- 基于OpenGL的仿蝗虫机器人三维动态仿
- 图形学 - OpenGL实现3种三维茶壶显示源
- opengl程序-会跳舞的骷髅
- opengl实现三维网格光顺Laplacian算法
- opengl——爆炸
- OpenGL三维地形建模
- opengl游戏编程徐明亮版(含源码)
- 用OPENGL画的一个简单的直升飞机
- opengl完美天空盒
- 3D绘图程序设计:使用Direct3D 10/9和Ope
- OpenGL绘制可运动自行车源程序.zip
- OpenGL实现飘动效果
- opengl室内场景的绘制,包括碰撞检测
评论
共有 条评论