资源简介
MIT最新的计算机图形学课程资源。包含课件和代码的下载
代码片段和文件信息
/* The documentation for camera is in the header file camera.h. */
#include
#include
#include
#include
// NOTE: the “static“ modifier means that the variable or function is private to this file.
static double eyex = 0 eyey = 0 eyez = 30;
static double refx = 0 refy = 0 refz = 0;
static double upx = 0 upy = 1 upz = 0;
static double xminRequested = -5 xmaxRequested = 5;
static double yminRequested = -5 ymaxRequested = 5;
static double zmin = -10 zmax = 10;
static int orthographic = 0;
static int preserveAspect = 1;
static double xminActual xmaxActual yminActual ymaxActual;
void cameraSetOrthographic(int ortho) {
orthographic = ortho;
}
void cameraSetPreserveAspect(int preserve) {
preserveAspect = preserve;
}
void cameraSetLimits(double xmin double xmax double ymin double ymax double zmin1 double zmax1) {
xminRequested = xminActual = xmin;
xmaxRequested = xmaxActual = xmax;
yminRequested = yminActual = ymin;
ymaxRequested = ymaxActual = ymax;
zmin = zmin1;
zmax = zmax1;
}
void cameraSetScale(double limit) {
cameraSetLimits(-limitlimit-limitlimit-2*limit2*limit);
}
void cameraLookAt(double eyeX double eyeY double eyeZ
double viewCenterX double viewCenterY double viewCenterZ
double viewUpX double viewUpY double viewUpZ) {
eyex = eyeX;
eyey = eyeY;
eyez = eyeZ;
refx = viewCenterX;
refy = viewCenterY;
refz = viewCenterZ;
upx = viewUpX;
upy = viewUpY;
upz = viewUpZ;
}
static double norm(double v0 double v1 double v2) {
double norm2 = v0*v0 + v1*v1 + v2*v2;
return sqrt(norm2);
}
static void normalize(double v[]) {
double n = norm(v[0]v[1]v[2]);
v[0] /= n;
v[1] /= n;
v[2] /= n;
}
void cameraApply() {
int viewport[4];
glGetIntegerv(GL_VIEWPORT viewport);
xminActual = xminRequested;
xmaxActual = xmaxRequested;
yminActual = yminRequested;
ymaxActual = ymaxRequested;
if (preserveAspect) {
double viewWidth = viewport[2];
double viewHeight = viewport[3];
double windowWidth = xmaxActual - xminActual;
double windowHeight = ymaxActual - yminActual;
double aspect = viewHeight / viewWidth;
double desired = windowHeight / windowWidth;
if (desired > aspect) { //expand width
double extra = (desired / aspect - 1.0) * (xmaxActual - xminActual) / 2.0;
xminActual -= extra;
xmaxActual += extra;
} else if (aspect > desired) {
double extra = (aspect / desired - 1.0) * (ymaxActual - yminActual) / 2.0;
yminActual -= extra;
ymaxActual += extra;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-04 20:36 graphicsbook-1.2-web-site\
目录 0 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\
文件 1775 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\affine-transform-matrix-2d.png
文件 4719 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\rgb-triangle-webgl.png
文件 17365 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\s5.html
文件 12524 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\nested-squares.png
文件 270691 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\cubemap-fisheye.png
文件 42521 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\s3.html
文件 50693 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\s4.html
文件 386385 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\multi-texture.png
文件 5815 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\index.html
文件 11286 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\textures-from-pixels.png
文件 19978 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\webgl-dataflow.png
文件 66294 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\texture-units-and-ob
文件 45740 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\s2.html
文件 52662 2018-01-04 20:36 graphicsbook-1.2-web-site\c6\s1.html
目录 0 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\
文件 51645 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\s6.html
文件 56822 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\scene-graph.png
文件 14222 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\convexity.png
文件 24529 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\pixel-coordinates.png
文件 45342 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\filled-shapes.png
文件 8016 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\antialiased-line.png
文件 44485 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\s7.html
文件 9777 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\old-to-new-coords.png
文件 4733 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\line-attributes.png
文件 47131 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\RotatedStringAndImage.jpg
文件 9438 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\ovals.png
文件 51793 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\s5.html
文件 5220 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\cart.png
文件 1617 2018-01-04 20:36 graphicsbook-1.2-web-site\c2\hierarchical-animation.svg
............此处省略560个文件信息
相关资源
- ArcGIS 10.6 crack
- 成都市矢量图shp格式高清
- 城市网络Arcgis分析插件
- 计算海洋声学课件
- ARCGIS在交通行业中的应用
- Introduction to Linear Algebra5ed by Gilbert S
- ArcGIS 10.2.2 License Manager
- ArcGIS地理信息系统空间分析实验教程
- Applied Nonlinear Control (MIT教材)
- MIT Computation structures
- 2019 全国铁路网.zip
- linear algebra lecture MIT线性代数课程资
- Dummit & Foote - Abstract Algebra 3rd Edition
- jeecg3.8版本
- learning with kernel MIT.pdf
- ArcGIS地理信息系统空间分析实验教程
- ArcGIS Server开发指南基于Flex和.Net
- ArcGIS Engine/VS开发程序 空间分析程序系
- 全国省市县级行政区划及其他SHP文件
- 数据通信与网络第五版英文版Forouza
- BIM数据导入ArcGIS解决方案,包含数据
- ArcGIS 10.1 crack+注册机
- ArcGIS9.2 License 破解文件 更新至2019年可
- ARCGIS Desktop 9.3 无期限授权文件及Lic
- CGAN代码及数据集
- ArcGIS_Editor_OSM_10_2Desktop OSM转Shp的ArcG
- JEECG开发全套文档
- 概率导论 美Dimitri-P.-Bertsekas
- Arcgis地图底图加载插件
- 2017CGenerator.exe
评论
共有 条评论