# Mesh shape splitting on one side

The issue that I’m referring to is presumably to do with the calculations that can be found both in the setup and update:
//remove split but is problematic on the right side
phi = ofMap(j, 0, gridHeight-1, 0, PI);
theta = ofMap(i, 0, gridWidth-1, 0, 2*PI);

this problem shows up visibly in the scenes past 25seconds when the shape begins to change, however it is existing from the start for sure.
Thanks in advance for any guidance!

#include “ofApp.h”

//--------------------------------------------------------------
void ofApp::setup(){

``````ofBackground(255);

gridWidth = 300;
gridHeight = 300;

//making the initial sphere
for(int j=0; j<gridWidth; j++){
for(int i=0; i<gridHeight; i++){

//remove split but is problematic on the right side
phi = ofMap(j, 0, gridHeight-1, 0, PI);
theta = ofMap(i, 0, gridWidth-1, 0, 2*PI);

}

}

//defining the indicies
for(int y=0; y<gridWidth-1; y++){
for(int x=0; x<gridHeight-1; x++){

a = x + gridWidth*y;
b = (x+1) + gridWidth*y;
c = x + gridWidth * (y+1);
d = (x+1)+ gridWidth * (y+1);

}
}
``````

}

//--------------------------------------------------------------
void ofApp::update(){

``````//adding movement
float wob = ofGetElapsedTimef();

for(int j=0; j<gridWidth; j++){
for(int i=0; i<gridHeight; i++){

int index = i+gridWidth*j;
ofPoint p = mesh.getVertex(index);

//if you remove 2* you can see only half being split but if I were to also multiply in the first line it still doesn't slove it
phi = ofMap(j, 0, gridHeight-1, 0, PI);
theta = ofMap(i, 0, gridWidth-1, 0, 2*PI);

//radius = 300 * (ofNoise(phi*mouseX/300, theta*mouseY/300, wob*1)); (used previously to find coordinates)
radius = 300 * (ofNoise(phi*mx/300, theta*my/300, wob*1));