Skip to content

Instantly share code, notes, and snippets.

@notmasteryet
Created April 2, 2011 03:37
Show Gist options
  • Save notmasteryet/899209 to your computer and use it in GitHub Desktop.
Save notmasteryet/899209 to your computer and use it in GitHub Desktop.
generate pjs test from p5
StringBuffer buf = new StringBuffer();
buf.append("//[").append(width).append(",").append(height).append("]");
loadPixels();
for (int i = 0, pos = 0; i < height; ++i) {
for (int j = 0; j < width; ++j) {
color c = pixels[pos++];
buf.append(255 & (c >> 16)).append(",").append(255 & (c>>8)).append(",").
append(255 & c).append(",").append(255 & (c >> 24)).append(",");
}
}
buf.setLength(buf.length() - 1);
print(buf.toString());
Index: core/src/processing/core/PGraphics.java
===================================================================
--- core/src/processing/core/PGraphics.java (revision 7831)
+++ core/src/processing/core/PGraphics.java (working copy)
@@ -2179,7 +2179,7 @@
normal(sphereX[i], sphereY[i], sphereZ[i]);
vertex(r * sphereX[i], r *sphereY[i], r * sphereZ[i]);
}
- //normal(0, -1, 0);
+ normal(0, -1, 0);
vertex(0, -1, 0);
normal(sphereX[0], sphereY[0], sphereZ[0]);
vertex(r * sphereX[0], r * sphereY[0], r * sphereZ[0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment