comparison cmd/tin2octree/builder.go @ 678:7bb961d750b6 octree

octree: traverse horizontally over tree to find out which triangles to process.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 19 Sep 2018 17:34:19 +0200
parents 1cb565d244cf
children b17e3ce53285
comparison
equal deleted inserted replaced
675:1cb565d244cf 678:7bb961d750b6
46 min, max vertex, 46 min, max vertex,
47 depth int, 47 depth int,
48 ) int32 { 48 ) int32 {
49 if len(triangles) <= 16 || depth > 8 { 49 if len(triangles) <= 16 || depth > 8 {
50 pos := len(tb.index) 50 pos := len(tb.index)
51 tb.index = append(tb.index, int32(len(tb.index))) 51 tb.index = append(tb.index, int32(len(triangles)))
52 tb.index = append(tb.index, triangles...) 52 tb.index = append(tb.index, triangles...)
53 //log.Printf("leaf entries: %d (%d)\n", len(triangles), depth) 53 //log.Printf("leaf entries: %d (%d)\n", len(triangles), depth)
54 tb.leaves++ 54 tb.leaves++
55 return int32(-(pos + 1)) 55 return int32(-(pos + 1))
56 } 56 }