@@ -125,19 +125,19 @@ public Lightmapper(Document document) {
125
125
TextureU = ( decimal ) ( x . TextureU ) ,
126
126
TextureV = ( decimal ) ( x . TextureV ) ,
127
127
} ) ;
128
- tFace . Vertices . Clear ( ) ;
129
- tFace . Vertices . AddRange ( verts ) ;
130
- /*for (int i = 0; i < mesh.Vertices.Count - 1; i+=2) {
131
- tFace.Vertices.Add(verts.ElementAt(i+0));
128
+ for ( int i = 0 ; i < mesh . Vertices . Count ; i += 3 ) {
129
+ tFace . Vertices . Clear ( ) ;
130
+ tFace . Vertices . Add ( verts . ElementAt ( i ) ) ;
132
131
tFace . Vertices . Add ( verts . ElementAt ( i + 1 ) ) ;
133
- }*/
134
- tFace . Plane = new DataStructures . Geometric . Plane ( tFace . Vertices [ 0 ] . Location , tFace . Vertices [ 1 ] . Location , tFace . Vertices [ 2 ] . Location ) ;
135
- tFace . Vertices . ForEach ( v => { v . LMU = - 500.0f ; v . LMV = - 500.0f ; } ) ;
136
- tFace . UpdateBoundingBox ( ) ;
137
- LMFace face = new LMFace ( tFace . Clone ( ) ) ;
138
- BoxF faceBox = new BoxF ( face . BoundingBox . Start - new Vector3F ( 3.0f , 3.0f , 3.0f ) , face . BoundingBox . End + new Vector3F ( 3.0f , 3.0f , 3.0f ) ) ;
139
- // opaqueFaces.Add(face);
140
- modelFaces . Add ( face ) ;
132
+ tFace . Vertices . Add ( verts . ElementAt ( i + 2 ) ) ;
133
+ tFace . Plane = new DataStructures . Geometric . Plane ( tFace . Vertices [ 0 ] . Location , tFace . Vertices [ 1 ] . Location , tFace . Vertices [ 2 ] . Location ) ;
134
+ tFace . Vertices . ForEach ( v => { v . LMU = - 500.0f ; v . LMV = - 500.0f ; } ) ;
135
+ tFace . UpdateBoundingBox ( ) ;
136
+ LMFace face = new LMFace ( tFace . Clone ( ) ) ;
137
+ BoxF faceBox = new BoxF ( face . BoundingBox . Start - new Vector3F ( 3.0f , 3.0f , 3.0f ) , face . BoundingBox . End + new Vector3F ( 3.0f , 3.0f , 3.0f ) ) ;
138
+ // opaqueFaces.Add(face);
139
+ modelFaces . Add ( face ) ;
140
+ }
141
141
}
142
142
}
143
143
}
0 commit comments