Not sure what I changed

This commit is contained in:
Carlos Sanchez 2024-07-29 20:56:31 -04:00
parent b4bdb18867
commit 7b86311ff2

View File

@ -51,6 +51,8 @@ func (m *Mat44f) SetProjection(fov float32, near float32, far float32) {
// 0 0 -f/(f-n) -1 // 0 0 -f/(f-n) -1
// 0 0 -fn/(f-n) 0 // 0 0 -fn/(f-n) 0
// where S (scale) is 1 / tan(fov / 2) (assuming fov is radians) // where S (scale) is 1 / tan(fov / 2) (assuming fov is radians)
// NOTE: -1 there is actually -1/c, where c is distance from viewer to
// projection plane. We fix it at 1 for now but...
m.ZeroFill() m.ZeroFill()
scale := float32(1 / math.Tan(float64(fov)*0.5*math.Pi/180)) scale := float32(1 / math.Tan(float64(fov)*0.5*math.Pi/180))
m.Set(0, 0, scale) m.Set(0, 0, scale)