ProcessingでもCinderのgeom::Sphere()や,
oFのofSpherePrimitiveのgetMesh()的なのができた.
これでプリミティブのPShapeを生成できるみたい.
参考URL
https://processing.org/tutorials/pshape/
http://processing.github.io/processing-javadocs/core/processing/core/PShape.html
PShapeSample.pde
PImage img;
PShape sphere;
PShape box;
void setup() {
size(600, 600, P3D);
img = loadImage("world32k.jpg");
sphere = createShape(SPHERE, 100);
sphere.setTexture(img);
sphere.setStrokeWeight(0);
box = createShape(BOX, 100);
box.setTexture(img);
box.setStrokeWeight(0);
}
void draw(){
background(0);
pushMatrix();
translate(width/3, height/2, 100);
rotateX(map(mouseY, 0, width, -PI, PI));
rotateY(map(mouseX, 0, width, -PI, PI));
shape(sphere);
popMatrix();
pushMatrix();
translate(width/3 * 2, height/2, 100);
rotateX(map(mouseY, 0, width, -PI, PI));
rotateY(map(mouseX, 0, width, -PI, PI));
shape(box);
popMatrix();
}