Common subdirectories: core/.svn and core.4147/.svn diff core/PApplet.java core.4147/PApplet.java 7423,7428d7422 < public void sphereDetail(int ures, int vres) { < if (recorder != null) recorder.sphereDetail(ures, vres); < g.sphereDetail(ures, vres); < } < < diff core/PGraphics.java core.4147/PGraphics.java 597,599c597 < // [davbol 2008-08-01] split into sphereDetailU and sphereDetailV < public int sphereDetailU = 0; // x or theta, range 2pi, "around" the sphere < public int sphereDetailV = 0; // y or phi, range pi, "top-to-bottom" along the sphere --- > public int sphereDetail = 0; 1655,1659d1652 < // [davbol 2008-08-01] < public void sphereDetail(int ures, int vres) { < depthError("sphereDetail"); < } < diff core/PGraphics3D.java core.4147/PGraphics3D.java 2432,2440c2432,2442 < // [davbol 2008-08-01] new sphereDetailU/V support < public void sphereDetail(int ures, int vres) { < if (ures < 3) ures = 3; // force a minimum res < if (vres < 2) vres = 3; // force a minimum res < if ((ures == sphereDetailU) && (vres == sphereDetailV)) return; < < float delta = (float)SINCOS_LENGTH/ures; < float[] cx = new float[ures]; < float[] cz = new float[ures]; --- > > // [toxi031031] used by the new sphere code below > // precompute vertices along unit sphere with new detail setting > > public void sphereDetail(int res) { > if (res < 3) res = 3; // force a minimum res > if (res == sphereDetail) return; > > float delta = (float)SINCOS_LENGTH/res; > float[] cx = new float[res]; > float[] cz = new float[res]; 2442c2444 < for (int i = 0; i < ures; i++) { --- > for (int i = 0; i < res; i++) { 2448c2450 < int vertCount = ures * (vres-1) + 2; --- > int vertCount = res * (res-1) + 2; 2456c2458 < float angle_step = (SINCOS_LENGTH*0.5f)/vres; --- > float angle_step = (SINCOS_LENGTH*0.5f)/res; 2460c2462 < for (int i = 1; i < vres; i++) { --- > for (int i = 1; i < res; i++) { 2463c2465 < for (int j = 0; j < ures; j++) { --- > for (int j = 0; j < res; j++) { 2470,2478c2472 < sphereDetailU = ures; < sphereDetailV = vres; < } < < // [toxi031031] used by the new sphere code below < // precompute vertices along unit sphere with new detail setting < // [davbol 2008-08-01] just call the two-param version < public void sphereDetail(int res) { < sphereDetail(res,res); --- > sphereDetail = res; 2500,2501d2493 < * < * [davbol 2008-08-01] now using separate sphereDetailU/V 2509c2501 < if ((sphereDetailU < 3) || (sphereDetailV < 2)) { --- > if (sphereDetail == 0) { 2524c2516 < for (int i = 0; i < sphereDetailU; i++) { --- > for (int i = 0; i < sphereDetail; i++) { 2538c2530 < for(int i = 2; i < sphereDetailV; i++) { --- > for(int i = 2; i < sphereDetail; i++) { 2540c2532 < voff += sphereDetailU; --- > voff += sphereDetail; 2543c2535 < for (int j = 0; j < sphereDetailU; j++) { --- > for (int j = 0; j < sphereDetail; j++) { 2561c2553 < for (int i = 0; i < sphereDetailU; i++) { --- > for (int i = 0; i < sphereDetail; i++) {