@@ -0,0 +1,1584 @@
+package com.haxademic.demo.math;%0A%0Aimport com.haxademic.core.app.P;%0Aimport com.haxademic.core.app.PAppletHax;%0Aimport com.haxademic.core.debug.DebugView;%0Aimport com.haxademic.core.draw.color.ColorsHax;%0Aimport com.haxademic.core.draw.context.PG;%0Aimport com.haxademic.core.draw.filters.pshader.BrightnessStepFilter;%0Aimport com.haxademic.core.draw.shapes.PShapeUtil;%0Aimport com.haxademic.core.math.SphericalCoord;%0A%0Aimport processing.core.PShape;%0Aimport processing.core.PVector;%0A%0Apublic class Demo_RandomUniformPointOnSphere%0Aextends PAppletHax %7B%0A%09public static void main(String args%5B%5D) %7B arguments = args; PAppletHax.main(Thread.currentThread().getStackTrace()%5B1%5D.getClassName()); %7D%0A%09%0A%09protected PShape shapeGroup;%0A%09%0A%09protected void firstFrame() %7B%0A%09%09shapeGroup = p.createShape(P.GROUP);%0A%09%7D%0A%0A%09protected void drawApp() %7B%0A%09%09// fade %0A%09%09if(p.frameCount == 1) background(0);%0A%09%09BrightnessStepFilter.instance(p).setBrightnessStep(-10/255f);%0A%09%09BrightnessStepFilter.instance(p).applyTo(p);%0A%09%09PG.setDrawCorner(p);%0A%09%09p.noStroke();%0A%09%09PG.setCenterScreen(p);%0A%09%09PG.setBetterLights(p.g);%0A%09%09PG.basicCameraFromMouse(p.g);%0A%0A%09%09// add spheres to group%0A%09%09DebugView.setValue(%22shapeGroup.getChildCount()%22, shapeGroup.getChildCount());%0A%09%09if(shapeGroup.getChildCount() %3C 500) %7B%0A%09%09%09for(int i=0; i %3C 10; i++) %7B%0A%09%09%09%09PVector randPoint = SphericalCoord.randomUniformCoord(p.height * 0.3f, true);%0A%09%09%09%09float shapeSize = 20;%0A%09%09%09%09shapeGroup.addChild(PShapeUtil.createSphere(shapeSize, randPoint.x, randPoint.y, randPoint.z, ColorsHax.colorFromGroupAt(0, i), 0, 0));%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09// draw to screen%0A%09%09p.shape(shapeGroup);%0A%09%7D%0A%7D%0A

Create Demo_RandomUniformPointOnSphere.java