【Berkeley CS184/284A】Computer Graphics and Imaging 学习笔记

Lecture 1: Introduction

Lecture 2: Drawing Triangles

GCL库的使用

见使用文档 Primer on Using Vectors and Matrices in the CGL Library 以及 CGL Vectors Library,此处给出一些文档中没提到的

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Matrix3x3 mat(1, 1, 1, 0, 1, 1, 0, 0, 1);
/* [1 1 1]
[0 1 1]
[0 0 1] */
mat.T();
/* [1 0 0]
[1 1 0]
[1 1 1] */
mat[0];
// (1, 0, 0)
Vector3D vec(1, .1, .01);
// (1, .1, .01)
vec.x;
// 1
vec[1];
// .1
dot(vec, vec);
// 1.2321
mat * vec;
// (1.11, .11, .01)

Reference


【Berkeley CS184/284A】Computer Graphics and Imaging 学习笔记
https://blog.iks-ran.com/2024/09/27/cs184/
Author
iks-ran
Posted on
September 27, 2024
Licensed under