E/AndroidRuntime(637): Caused by: java.lang.RuntimeException: P3D: OpenGL ES 2.0 is not supported by this device.
import remixlab.proscene.*; Scene scene; ArrayList<Box> boxes = new ArrayList<Box>(); int sizeMin = 5; int sizeMax = 30; int columns = 5; int rows = 5; int xSpacing = 25; int ySpacing = 25; float xOffset = (sizeMax + xSpacing) * (columns - 1); float yOffset = (sizeMax + ySpacing) * (rows - 1); public void setup() { size(640, 360, P3D); scene = new Scene(this); scene.setCameraType(Camera.Type.ORTHOGRAPHIC); scene.setRadius(200); scene.disableKeyboardHandling(); scene.showAll(); setupBoxes(); } public void setupBoxes() { boxes.clear(); for (int i = 0; i < columns; i++) { for (int j = 0; j < rows; j++) { float x = xOffset / 2 - i * (sizeMax + xSpacing); float y = yOffset / 2 - j * (sizeMax + ySpacing); Box box = new Box(scene); box.setSize(random(sizeMin, sizeMax), random(sizeMin, sizeMax), random(sizeMin, sizeMax)); box.setPosition(new PVector(x, y)); box.setColor(color(random(255), 0, 255)); boxes.add(box); } } } public void draw() { background(155); for (int i = 0; i < boxes.size(); i++) boxes.get(i).draw(); } public void keyPressed() { if (key == ' ') if (scene.mouseGrabber() != null) { Box box = (Box) scene.mouseGrabber(); scene.camera().interpolateToZoomOnRegion(box.rect()); // comment the line above and uncomment the lines below to use // interpolateToFitScene // PVector sceneCenter = scene.camera().sceneCenter().get(); // float sceneRadius = scene.camera().sceneRadius(); // // scene.setCenter(box.position()); // scene.setRadius(scene.camera().type() == // Camera.Type.ORTHOGRAPHIC ? 40 // : 20); // scene.camera().interpolateToFitScene(); // // scene.setCenter(sceneCenter); // scene.setRadius(sceneRadius); } } public class Box extends InteractiveFrame { InteractiveFrame frame; float w, h, d; int c; Box(Scene _scene) { super(_scene); } public void draw() { pushMatrix(); pushStyle(); applyTransformation(); noStroke(); if (grabsMouse()) fill(255, 0, 0); else fill(c); box(w, h, d); popStyle(); popMatrix(); } public void setSize(float myW, float myH, float myD) { w = myW; h = myH; d = myD; } public void setColor(int myC) { c = myC; } public Rectangle rect() { return new Rectangle((int) position().x, (int) position().y, (int) w, (int) h); } }
GSVideo version: 0.8
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: Unable to load library 'gstreamer-0.10': dlopen(libgstreamer-0.10.dylib, 9): image not found
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:379)
at org.gstreamer.lowlevel.GNative.loadNativeLibrary(GNative.java:48)
at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:45)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)
at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)
at org.gstreamer.Gst.<clinit>(Gst.java:59)
at codeanticode.gsvideo.GSVideo.initImpl(GSVideo.java:129)
at codeanticode.gsvideo.GSVideo.init(GSVideo.java:86)
at codeanticode.gsvideo.GSMovie.<init>(GSMovie.java:92)
at codeanticode.gsvideo.GSMovie.<init>(GSMovie.java:69)
at GSVideo_Loop_Test.setup(GSVideo_Loop_Test.java:28)
at processing.core.PApplet.handleDraw(PApplet.java:1578)
at processing.core.PApplet.run(PApplet.java:1498)
at java.lang.Thread.run(Thread.java:637)
import java.util.Arrays; import java.util.Comparator; import toxi.geom.*; import toxi.processing.*; ToxiclibsSupport gfx; int count = 2; float sizeMin = 25; float sizeMax = 100; Circle[] circles; public void setup() { size(800, 600, P3D); noFill(); gfx = new ToxiclibsSupport(this); setupCircles(); } public void setupCircles() { circles = new Circle[count]; for (int i = 0; i < count; i++) circles[i] = new Circle((int) random(sizeMax, width - sizeMax), (int) random(sizeMax, height - sizeMax), random(sizeMin, sizeMax)); // circles[0] = new Circle(250, height / 2, 150); // circles[1] = new Circle(625, height / 2, 75); Arrays.sort(circles, new CircleXComparator()); } public void draw() { background(255); for (int i = 0; i < count; i++) { stroke(0); noFill(); gfx.ellipse(circles[i]); if (i > 0) { Circle c1 = circles[i - 1]; Circle c2 = circles[i]; // circle 1 thetas float c1a2 = 2 * acos((c1.getRadius() - c2.getRadius()) / c1.distanceTo(c2)); float c1a1 = c1a2 / 2; // circle 2 thetas float c2a2 = 2 * acos((c2.getRadius() - c1.getRadius()) / c2.distanceTo(c1)); float c2a1 = c1a2 / 2; // circle 1 points Vec2D c1v1 = new Vec2D(c1.x() + cos(c1a1) * c1.getRadius(), c1.y() + sin(c1a1) * c1.getRadius()); Vec2D c1v2 = new Vec2D(c1.x() + cos(c1a2) * c1.getRadius(), c1.y() + sin(c1a2) * c1.getRadius()); // circle 2 points Vec2D c2v1 = new Vec2D(c2.x() + cos(c2a1) * c2.getRadius(), c2.y() + sin(c2a1) * c2.getRadius()); Vec2D c2v2 = new Vec2D(c2.x() + cos(c2a2) * c2.getRadius(), c2.y() + sin(c2a2) * c2.getRadius()); // circle 1 to circle 2 line gfx.line(new Line2D(c1, c2)); // circle 1 lines stroke(255, 0, 0); gfx.line(new Line2D(c1, c1v1)); gfx.line(new Line2D(c1, c1v2)); // circle 2 lines gfx.line(new Line2D(c2, c2v1)); gfx.line(new Line2D(c2, c2v2)); // gfx.polygon2D((new Polygon2D(c1v1,c1v2,c2v1,c2v2)); Polygon2D p1 = new Polygon2D(); p1.add(c1v1); p1.add(c1v2); p1.add(c2v2); p1.add(c2v1); stroke(0, 255, 0); gfx.polygon2D(p1); } } } public void keyPressed() { setupCircles(); } public class CircleXComparator implements Comparator<Circle> { public int compare(Circle _c1, Circle _c2) { return (int) (_c1.x() - _c2.x()); } }