I’m trying to just have half a sphere using ofSpherePrimitive but I can’t find a method to do that.
Is there any way to do this?
I’m trying to just have half a sphere using ofSpherePrimitive but I can’t find a method to do that.
Is there any way to do this?
I think you can do it by using a representation of the sphere in 3D :
looping in (i,j) :
float latitude = ofMap(i, 0, amount, -M_PI / 2, M_PI / 2);
float longitude = ofMap(j, 0, amount, -M_PI, M_PI);
float x = radius * r1 * cos(longitude) * r2 * cos(latitude);
float y = radius * r1 * sin(longitude) * r2 * cos(latitude);
float z = radius * r2 * sin(latitude);
ofVec3f v = {x, y, z};
and then , instead of going from -M_PI to M_PI, you can use 0-M_PI.
That’s what I would do.
Hope it helps.
++