-
大小: 13KB文件类型: .zip金币: 1下载: 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实现的光线跟踪
- 利用OpenGL实现屏幕坐标与世界坐标的
- OpenGL画花瓶,可以填充,选择颜色 代
- 基于OpenGL的B样条曲线曲面的绘制
- 基于OpenGL虚拟校园漫游系统的设计与
- 用OPENGL读取MS3D文件
- OpenGL安装文件及安装方法
- openGL Matrix类的实现,包括和四元数、
- OPENGL五角星
- opengl雪花代码
- OpenGL的B样条、贝塞尔曲线和贝塞尔曲
- opengl\\雷达三维成像和雷达视觉
- 用opengl编写的一个小游戏
- openGL 模拟太阳系行星自转公转
- 读取DXF文件并在OpenGL中显示.
- 用VC opengl 绘制的一个房屋轮廓
- opengl类库大全glaux.lib;glu.lib;glu32.lib;
- OpenGL实现的3D魔方
- OPenGL中绘制茶杯模型
- 刚学的OpenGL画五角星
- Qt自定义继承QOpenGLWidget的类进行绘图
- 读取obj文件含顶点法线,2013编译通过
- OpenGL画树的代码
- OpenGL开发的机械臂运动仿真程序
- Phong光照及在GLSL中使用函数
- 现代OpenGL+Qt:绘制可旋转、带光照效
- 现代OpenGL+Qt学习笔记之四:使用Unif
- 现代OpenGL+Qt学习笔记之三:显示一个
- 现代OpenGL+Qt学习笔记之二:程序框架
- OpenGL显示汉字
评论
共有 条评论