- Tuple<Vector3 , float> [ ] planes = new Tuple<Vector3 , float> [ 1 ] {
- new Tuple<Vector3 , float>( -plane.Normal , -plane.Distance ) };
- for (int i = 0; i < pp.Count; i++) {
- Vector3 a = (other - pp[i]);
- Vector3 b = (other - pp[(i +1) % pp.Count]);
- a.Normalize();
- b.Normalize();
- Vector3 normb = Vector3.Cross(a,b);
- normb.Normalize();
- planes = planes.Concat( new [ ] { new Tuple<Vector3 , float>( normb , Vector3.Dot( normb ,other ) ) } ).ToArray( );
- }
- polyhedra.Add(new Polyhedron(planes));