Various bug fixes + Material setters
This commit is contained in:
parent
e35cca1830
commit
f5c912c489
5 changed files with 53 additions and 22 deletions
2
vec3.go
2
vec3.go
|
|
@ -69,7 +69,7 @@ func (u Vector3) Min(x float64) Vector3 {
|
|||
// i incident, n normal. Both vector should be normalized
|
||||
func Reflect(i Vector3, n Vector3) Vector3 {
|
||||
y := i.Dot(n)
|
||||
return (i.Add(n.Scale(2 * y))).Normalized()
|
||||
return (n.Scale(2 * y)).Sub(i)
|
||||
}
|
||||
|
||||
// Todo : Refract
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue