We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Is it just me, or does anyone else get the feeling there's something not quite right with the sphere() mesh?
void setup() {
size(480, 480, P3D);
colorMode(HSB, 6.0, 1.0, 1.0, 1.0);
noFill();
}
void draw()
{ // For tweaking
translate(width/2, height/2);
background(0);
stroke(0.0, 0.4, 1.0, 0.5);
rotateX(-0.1);
rotateY(0.01*millis()/100);
strokeWeight(5);
sphereDetail(4);sphere(100);
}
Answers
Can you be more specific about exactly what you think is incorrect?
Note that a sphere is a series of triangles, not edges, so two triangles will share the same edge, if that's what you're talking about.
@chrisjj --
if you want to quickly understanding of how this triangle edge sharing works out at many different detail levels:
Menu > Sketch > Tweak
for Tweaks mode.sphereDetail()
and try dragging it right and left -- way up and all the way down.jeremydouglass, this duplication appears near one pole at every different spehereDetail() value I have tried.
Again, what is the duplication?
the brighter line at the bottom of the northern cap is from two identical lines being drawn on top of each other.
(the sphere is actually 3 different bits, a triangle fan at the top and bottom, a triangle mesh for the rest of it.)
https://github.com/processing/processing/blob/7445d10718a9b2cdbf7c3b3469d37928e93695dd/core/src/processing/opengl/PGraphicsOpenGL.java#L9010
@KevinWorkman
I think the point @chrisjj is making is that, with transparency, it is visible that one and only one of the sphere rings (near the pole) is darker / less transparent, as if it is being drawn twice while all others are being drawn once. This isn't an artifact of camera angle -- it is the same ring, from any angle at any detail.
To see this in action, I added a 3D rotation and a time-based sphereDetail to the above sketch. You can clearly track one "heavy / less transparent" ring as the sphere tumbles and changes detail.
Triangular ring at the equator (pole-1):
Quad ring at pole-1:
Octagonal ring at pole-1:
Thanks Jeremy and koogs. I've reported it as an issue: https://github.com/processing/processing/issues/4720
This issue was resolved, the fix should be available in the next release: