public AddTriangleStrip ( IList |
||
stripPositions | IList |
/// The points of the triangle strip. /// |
stripNormals | IList |
/// The normal vectors of the triangle strip. /// |
stripTextureCoordinates | IList |
/// The texture coordinates of the triangle strip. /// |
return | void |
/// <summary> /// Do the tessellation and return the <see cref="MeshGeometry3D"/>. /// </summary> /// <returns>A triangular mesh geometry.</returns> protected override MeshGeometry3D Tessellate() { var pts = new List<Point3D>(); var right = Vector3D.CrossProduct(this.UpVector, this.Normal); for (int i = 0; i < this.ThetaDiv; i++) { double angle = this.StartAngle + ((this.EndAngle - this.StartAngle) * i / (this.ThetaDiv - 1)); double angleRad = angle / 180 * Math.PI; var dir = (right * Math.Cos(angleRad)) + (this.UpVector * Math.Sin(angleRad)); pts.Add(this.Center + (dir * this.InnerRadius)); pts.Add(this.Center + (dir * this.OuterRadius)); } var b = new MeshBuilder(false, false); b.AddTriangleStrip(pts); return b.ToMesh(); }