Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 【作业3】在view space进行插值,结果会与文档中不一致 Reply To: 【作业3】在view space进行插值,结果会与文档中不一致

#4361 Score: 1
Angus
Participant
23 pts

因为它把x,y映射到0~255的方法是:
x,y ∈ [-1, 1]
x, y += 1
x,y ∈ [0, 2]
x, y /= 2
x,y ∈ [0, 1]
x, y *= 255.0f
x,y ∈ [0, 255.0f]

把z映射到128~255的方法是:
z ∈ [0, 1]
z += 1
z ∈ [1, 2]
z /= 2
z ∈ [0.5, 1]
z *= 255.0f
z ∈ [128.0f, 255.0f]

你可以看到这一加一除一乘三个操作完全一样,所以xyz一起映射与分开做是一样的。

This post has received 1 vote up.
  • This reply was modified 2 years, 6 months ago by Angus.