#### Howdy, Stranger!

We are about to switch to a new forum software. Until then we have removed the registration on this forum.

# How to hide sphere overlap point

edited January 2017

Hey everyone! I'm working on making a sphere out of individual points and calculating the radius of each point by the volume of the music. If you load my code you can see my problem. There is a big mark that indicates where the sphere starts and stops. Is there a way to make these two connected so it doesnt look as ugly? Any help is appreciated!!

``````import peasy.*;
import peasy.org.apache.commons.math.*;
import peasy.org.apache.commons.math.geometry.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;

PeasyCam cam;
Minim minim;
AudioPlayer player;
BeatDetect beat;
FFT fft;

PVector[][] globe;
color[][] colormap;
float[][] r;
int total = 100;
float nI=0;
float nJ=0;
float hu;
boolean calculated = false;
boolean up=true;
void setup() {
cam = new PeasyCam(this, 50);
minim = new Minim(this);
//player = minim.loadFile("D:/programeer gedoe/Programs/Music visualiser/PROCESSING VISUALIZER/Audio/SAIL - AWOLNATION.mp3");
//player = minim.loadFile("D:/programeer gedoe/Programs/Music visualiser/PROCESSING VISUALIZER/Audio/Ganja White Night - Mr Nice.mp3");
size(1000, 1000, P3D);
r = new float[total+1][total+1];
colormap = new color[total+1][total+1];
globe = new PVector[total+1][total+1];
colorMode(HSB);
smooth();
frameRate(30);
beat = new BeatDetect();
fft = new FFT(player.bufferSize(), player.sampleRate());
player.play(35000);
}

void draw() {
background(0);
lights();
noStroke();
// if (!calculated) {
//float nJ=0;
println("nI: " + nI);
println("nJ: " + nJ);
for (int i = 0; i < total+1; i++) {
float lat = map(i, 0, total, 0, PI);
for (int j = 0; j < total+1; j++) {
//if (j == total && i == total) {
//}
if (nI > 15 && up) {
up = false;
}
if (nI >= 15) {
up = false;
} else if (nI <= 0) {
up = true;
}
if (up) {
nI+=0.0000002;
nJ+=0.0000002;
} else {
nI-=0.0000005;
nJ-=0.0000005;
}
colormap[i][j] = color(hu, 255, 255);
//fill(hu, 255, 255);
float lon = map(j, 0, total, 0, TWO_PI);
float x = r[i][j]*cos(lon)*sin(lat);
float y = r[i][j]*sin(lat)*sin(lon);
float z = r[i][j]*cos(lat);
globe[i][j] = new PVector(x, y, z);
}
}
calculated = true;
//}

for (int i =0; i < total; i++) {
beginShape(TRIANGLE_STRIP);
for (int j = 0; j < total + 1; j++) {
fill(colormap[i][j]);
PVector v = globe[i][j];
PVector v2 = globe[i+1][j];
vertex(v.x, v.y, v.z);
fill(colormap[i+1][j]);
vertex(v2.x, v2.y, v2.z);
}
endShape();
}
}
``````
Tagged: