mobius3d static method

void mobius3d(
  1. double u,
  2. double t,
  3. Vector3 target
)

Implementation

static void mobius3d(double u,double t, Vector3 target ) {
	u *= math.pi;
	t *= 2 * math.pi;

	u = u * 2;
	double phi = u / 2;
	const major = 2.25, a = 0.125, b = 0.65;

	double x = a * math.cos( t ) * math.cos( phi ) - b * math.sin( t ) * math.sin( phi );
	final z = a * math.cos( t ) * math.sin( phi ) + b * math.sin( t ) * math.cos( phi );
	final y = ( major + x ) * math.sin( u );
	x = ( major + x ) * math.cos( u );

	target.setValues( x, y, z );
}