public void AddExtrudedGeometry(IList<Point> points, Vector3D xaxis, Point3D p0, Point3D p1)
{
var ydirection = Vector3D.CrossProduct(xaxis, p1 - p0);
ydirection.Normalize();
xaxis.Normalize();
int index0 = this.positions.Count;
int np = 2 * points.Count;
foreach (var p in points)
{
var v = (xaxis * p.X) + (ydirection * p.Y);
this.positions.Add(p0 + v);
this.positions.Add(p1 + v);
v.Normalize();
if (this.normals != null)
{
this.normals.Add(v);
this.normals.Add(v);
}
if (this.textureCoordinates != null)
{
this.textureCoordinates.Add(new Point(0, 0));
this.textureCoordinates.Add(new Point(1, 0));
}
int i1 = index0 + 1;
int i2 = (index0 + 2) % np;
int i3 = ((index0 + 2) % np) + 1;
this.triangleIndices.Add(i1);
this.triangleIndices.Add(i2);
this.triangleIndices.Add(index0);
this.triangleIndices.Add(i1);
this.triangleIndices.Add(i3);
this.triangleIndices.Add(i2);
}
}