欢迎来到CGLab

这里记录我学习 Computer Graphics / Rendering / Math 的过程。
test cover

Hugo 功能测试文章

Hugo 全功能测试 这是一篇用于测试 Hugo + PaperMod 博客功能是否正常的文章。 目录应该会自动生成。 1. 行内公式 这是一个行内公式: $E = mc^2$ 这是另一个: $\mathbf{v'} = R_z(\theta)\mathbf{v}$ 2. 块级公式 $$ f(x) = x^2 + 2x + 1 $$ 3. 矩阵测试(图形学重要) $$ R_z(\theta) = \begin{pmatrix} \cos\theta & -\sin\theta & 0 \\\\ \sin\theta & \cos\theta & 0 \\\\ 0 & 0 & 1 \end{pmatrix} $$ 4. 多行公式 $$ \begin{aligned} x' &= x\cos\theta - y\sin\theta \\\\ y' &= x\sin\theta + y\cos\theta \end{aligned} $$ 5. 代码高亮 (C++) 1#include <glm/glm.hpp> 2#include <glm/gtc/matrix_transform.hpp> 3 4glm::mat4 model = glm::rotate( 5 glm::mat4(1.0f), 6 glm::radians(45.0f), 7 glm::vec3(0,0,1) 8); 6. Shader 代码 (GLSL) 1vec3 rotateZ(vec3 p, float theta) 2{ 3 mat3 R = mat3( 4 cos(theta), -sin(theta), 0.0, 5 sin(theta), cos(theta), 0.0, 6 0.0, 0.0, 1.0 7 ); 8 9 return R * p; 10} 7. Python 代码 1import numpy as np 2 3theta = np.pi / 4 4 5R = np.array([ 6 [np.cos(theta), -np.sin(theta), 0], 7 [np.sin(theta), np.cos(theta), 0], 8 [0,0,1] 9]) 8. 表格 Algorithm Complexity Notes Ray Tracing O(n) realistic Rasterization O(1) fast Path Tracing expensive global illumination 9. 引用 Computer graphics is the art of turning mathematics into images. ...

March 15, 2026 · 2 min · 574 words · 氧均竭