Skip to content

Commit e21b239

Browse files
committed
fix normals
1 parent 0f56fd6 commit e21b239

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/primitives/Cone.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ function normals(c::Cone, nvertices = 30)
7979
# cap
8080
ns[end] = Vec3f(normalize(c.origin - c.tip))
8181

82-
return ns
82+
faces = Vector{GLTriangleFace}(undef, nvertices)
83+
84+
# shell
85+
for i in 1:nhalf
86+
faces[i] = GLTriangleFace(i, mod1(i+1, nhalf), nhalf+1)
87+
end
88+
89+
# cap
90+
for i in 1:nhalf
91+
faces[i+nhalf] = GLTriangleFace(nhalf + 2)
92+
end
93+
94+
return FaceView(ns, faces)
8395
end
8496

8597
function faces(::Cone, facets=30)

0 commit comments

Comments
 (0)