Drawing a Circle on a Sphere Using Spherical Coordinates  



I am doing some processing code to make a circle be drawn onto a sphere using spherical coordinates. Here's the gist of it:

class Circle {
float ro, theta, phi;
float x, y, z;
float r;

Circle(float ro1, float theta1, float phi1, float radius) {
ro = ro1;
theta = theta1;
phi = phi1;
r = radius;

x = ro * sin(phi) * cos(theta);
y = ro * sin(phi) * sin(theta);
z = ro * cos(phi);

void drawCircle() {
//Make a circle that has a radius that subtends an arc of it's radius (meaning the length along the sphere is it's r).

I have made a square and a circle when phi = 0, but all other attempts have failed. Help!

That one guy that's always on


Here's the github link in case you want to take a look at it here.

That one guy that's always on


Please Login or Register