Rendering.NET allows you to create a model with simple define a function that generate the vertices.

Two ways of specifying a sphere surface:

by a curve of a circumference prolonged among the y-axis and scaled with a semi circumference function
var sphere1 = new ManifoldModel(
    Manifold
        .Curve(t => new Vector3(GMath.cos(2 * PI * t), 0, GMath.sin(2 * PI * t)))
	.Promote((p, u) => p * GMath.sqrt(1 - GMath.sqr(1 - 2 * u)) + new Vector3(0, 1 - 2 * u, 0)), 32, 32);

by mapping the quad surface to the sphere surface using u and v as parameters
var sphere2 = new ManifoldModel(
    Manifold.Surface((u, v) =>
    {
        float radius = GMath.sqrt(1 - GMath.sqr(2 * u - 1));
	return new Vector3(radius * GMath.sin(2 * PI * v), 2 * u - 1, radius * GMath.cos(2 * PI * v));
    }), 32, 32);

Last edited Sep 26, 2012 at 8:07 PM by acoto, version 1

Comments

No comments yet.