diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-07-11 12:18:02 +0200 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-07-11 12:18:02 +0200 |
commit | 5273d5bcb66fa099d13effc155137fd7e47a4db0 (patch) | |
tree | 48492ae3bd6edecd32abf70b8f56f74e6fcd41fb /examples/HelloOBJ.hs | |
parent | b2b400c4a8a3a4c7e25ab45770962149a05a5d12 (diff) |
improve obj triangulation
Diffstat (limited to 'examples/HelloOBJ.hs')
-rw-r--r-- | examples/HelloOBJ.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/HelloOBJ.hs b/examples/HelloOBJ.hs index bffb10d..7ab6b20 100644 --- a/examples/HelloOBJ.hs +++ b/examples/HelloOBJ.hs | |||
@@ -36,7 +36,7 @@ objToMesh WavefrontOBJ{..} = [(toMesh faceGroup, elMtl . head $ faceGroup) | fac | |||
36 | } where | 36 | } where |
37 | triangulate (Triangle a b c) = [a,b,c] | 37 | triangulate (Triangle a b c) = [a,b,c] |
38 | triangulate (Quad a b c d) = [a,b,c, c,d,a] | 38 | triangulate (Quad a b c d) = [a,b,c, c,d,a] |
39 | triangulate _ = [] | 39 | triangulate (Face a b c l) = a : b : c : concatMap (\(x,y) -> [a,x,y]) (zip (c:l) l) -- should work for convex polygons without holes |
40 | defaultPosition = Location 0 0 0 0 | 40 | defaultPosition = Location 0 0 0 0 |
41 | defaultNormal = Normal 0 0 0 | 41 | defaultNormal = Normal 0 0 0 |
42 | defaultTexCoord = TexCoord 0 0 0 | 42 | defaultTexCoord = TexCoord 0 0 0 |