propane 3.4.1-java → 3.7.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mvn/extensions.xml +1 -1
- data/.mvn/wrapper/MavenWrapperDownloader.java +2 -2
- data/.mvn/wrapper/maven-wrapper.properties +2 -2
- data/.travis.yml +1 -1
- data/CHANGELOG.md +9 -1
- data/Gemfile +2 -0
- data/README.md +9 -5
- data/Rakefile +10 -11
- data/bin/propane +3 -1
- data/lib/propane.rb +4 -2
- data/lib/propane/app.rb +2 -1
- data/lib/propane/creators/sketch_class.rb +7 -1
- data/lib/propane/creators/sketch_factory.rb +4 -2
- data/lib/propane/creators/sketch_writer.rb +1 -0
- data/lib/propane/helper_methods.rb +22 -23
- data/lib/propane/helpers/numeric.rb +2 -0
- data/lib/propane/helpers/version_error.rb +1 -0
- data/lib/propane/library.rb +5 -1
- data/lib/propane/library_loader.rb +2 -0
- data/lib/propane/native_folder.rb +10 -9
- data/lib/propane/native_loader.rb +3 -0
- data/lib/propane/runner.rb +20 -14
- data/lib/propane/version.rb +2 -1
- data/library/boids/boids.rb +21 -11
- data/library/color_group/color_group.rb +2 -0
- data/library/control_panel/control_panel.rb +8 -5
- data/library/dxf/dxf.rb +2 -0
- data/library/file_chooser/chooser.rb +10 -9
- data/library/file_chooser/file_chooser.rb +10 -9
- data/library/library_proxy/library_proxy.rb +2 -0
- data/library/net/net.rb +2 -0
- data/library/simplex_noise/simplex_noise.rb +2 -0
- data/library/slider/slider.rb +23 -22
- data/library/vector_utils/vector_utils.rb +4 -0
- data/library/video_event/video_event.rb +2 -0
- data/pom.rb +37 -36
- data/pom.xml +6 -6
- data/propane.gemspec +12 -10
- data/src/main/java/japplemenubar/JAppleMenuBar.java +3 -3
- data/src/main/java/monkstone/ColorUtil.java +1 -3
- data/src/main/java/monkstone/MathToolModule.java +10 -9
- data/src/main/java/monkstone/PropaneLibrary.java +2 -2
- data/src/main/java/monkstone/fastmath/Deglut.java +1 -1
- data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
- data/src/main/java/monkstone/noise/SimplexNoise.java +2 -2
- data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SliderBar.java +1 -1
- data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
- data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
- data/src/main/java/monkstone/vecmath/package-info.java +1 -1
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +1 -1
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -2
- data/src/main/java/monkstone/videoevent/CaptureEvent.java +1 -1
- data/src/main/java/monkstone/videoevent/MovieEvent.java +1 -1
- data/src/main/java/monkstone/videoevent/package-info.java +1 -1
- data/src/main/java/processing/awt/PGraphicsJava2D.java +781 -285
- data/src/main/java/processing/awt/PImageAWT.java +377 -0
- data/src/main/java/processing/awt/PShapeJava2D.java +56 -52
- data/src/main/java/processing/awt/PSurfaceAWT.java +308 -208
- data/src/main/java/processing/awt/ShimAWT.java +581 -0
- data/src/main/java/processing/core/PApplet.java +4225 -4855
- data/src/main/java/processing/core/PConstants.java +477 -447
- data/src/main/java/processing/core/PFont.java +914 -880
- data/src/main/java/processing/core/PGraphics.java +150 -134
- data/src/main/java/processing/core/PImage.java +275 -372
- data/src/main/java/processing/core/PMatrix.java +172 -159
- data/src/main/java/processing/core/PMatrix2D.java +478 -415
- data/src/main/java/processing/core/PMatrix3D.java +762 -735
- data/src/main/java/processing/core/PShape.java +2887 -2651
- data/src/main/java/processing/core/PShapeOBJ.java +97 -92
- data/src/main/java/processing/core/PShapeSVG.java +1705 -1490
- data/src/main/java/processing/core/PStyle.java +40 -37
- data/src/main/java/processing/core/PSurface.java +139 -97
- data/src/main/java/processing/core/PSurfaceNone.java +296 -218
- data/src/main/java/processing/core/PVector.java +995 -963
- data/src/main/java/processing/core/ThinkDifferent.java +12 -8
- data/src/main/java/processing/data/DoubleDict.java +756 -710
- data/src/main/java/processing/data/DoubleList.java +749 -696
- data/src/main/java/processing/data/FloatDict.java +748 -702
- data/src/main/java/processing/data/FloatList.java +751 -697
- data/src/main/java/processing/data/IntDict.java +720 -673
- data/src/main/java/processing/data/IntList.java +699 -633
- data/src/main/java/processing/data/JSONArray.java +931 -873
- data/src/main/java/processing/data/JSONObject.java +1262 -1165
- data/src/main/java/processing/data/JSONTokener.java +351 -341
- data/src/main/java/processing/data/LongDict.java +710 -663
- data/src/main/java/processing/data/LongList.java +701 -635
- data/src/main/java/processing/data/Sort.java +37 -41
- data/src/main/java/processing/data/StringDict.java +525 -486
- data/src/main/java/processing/data/StringList.java +626 -580
- data/src/main/java/processing/data/Table.java +3690 -3510
- data/src/main/java/processing/data/TableRow.java +182 -183
- data/src/main/java/processing/data/XML.java +957 -883
- data/src/main/java/processing/event/Event.java +87 -67
- data/src/main/java/processing/event/KeyEvent.java +48 -41
- data/src/main/java/processing/event/MouseEvent.java +88 -113
- data/src/main/java/processing/event/TouchEvent.java +10 -6
- data/src/main/java/processing/javafx/PGraphicsFX2D.java +20 -345
- data/src/main/java/processing/javafx/PSurfaceFX.java +149 -121
- data/src/main/java/processing/net/Client.java +20 -20
- data/src/main/java/processing/net/Server.java +9 -9
- data/src/main/java/processing/opengl/FontTexture.java +286 -266
- data/src/main/java/processing/opengl/FrameBuffer.java +389 -377
- data/src/main/java/processing/opengl/LinePath.java +132 -89
- data/src/main/java/processing/opengl/LineStroker.java +588 -581
- data/src/main/java/processing/opengl/PGL.java +660 -567
- data/src/main/java/processing/opengl/PGraphics2D.java +408 -315
- data/src/main/java/processing/opengl/PGraphics3D.java +107 -72
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +12378 -12075
- data/src/main/java/processing/opengl/PJOGL.java +1753 -1670
- data/src/main/java/processing/opengl/PShader.java +369 -461
- data/src/main/java/processing/opengl/PShapeOpenGL.java +4678 -4580
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +1114 -1027
- data/src/main/java/processing/opengl/Texture.java +1492 -1401
- data/src/main/java/processing/opengl/VertexBuffer.java +57 -55
- data/test/create_test.rb +21 -20
- data/test/deglut_spec_test.rb +4 -2
- data/test/helper_methods_test.rb +49 -20
- data/test/math_tool_test.rb +39 -32
- data/test/native_folder.rb +47 -0
- data/test/respond_to_test.rb +3 -2
- data/test/sketches/key_event.rb +2 -2
- data/test/sketches/library/my_library/my_library.rb +3 -0
- data/test/test_helper.rb +2 -0
- data/test/vecmath_spec_test.rb +35 -22
- data/vendors/Rakefile +35 -40
- metadata +42 -22
- data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
- data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
@@ -570,7 +570,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
570
570
|
|
571
571
|
// vertices
|
572
572
|
public static final int DEFAULT_VERTICES = 512;
|
573
|
-
protected float
|
573
|
+
protected float[][] vertices =
|
574
574
|
new float[DEFAULT_VERTICES][VERTEX_FIELD_COUNT];
|
575
575
|
protected int vertexCount; // total number of vertices
|
576
576
|
|
@@ -605,7 +605,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
605
605
|
|
606
606
|
// spline vertices
|
607
607
|
|
608
|
-
protected float
|
608
|
+
protected float[][] curveVertices;
|
609
609
|
protected int curveVertexCount;
|
610
610
|
|
611
611
|
// ........................................................
|
@@ -618,8 +618,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
618
618
|
// [toxi 031031]
|
619
619
|
// changed table's precision to 0.5 degree steps
|
620
620
|
// introduced new vars for more flexible code
|
621
|
-
static final protected float sinLUT
|
622
|
-
static final protected float cosLUT
|
621
|
+
static final protected float[] sinLUT;
|
622
|
+
static final protected float[] cosLUT;
|
623
623
|
static final protected float SINCOS_PRECISION = 0.5f;
|
624
624
|
static final protected int SINCOS_LENGTH = (int) (360f / SINCOS_PRECISION);
|
625
625
|
static {
|
@@ -702,7 +702,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
702
702
|
|
703
703
|
// [toxi031031] new & faster sphere code w/ support flexible resolutions
|
704
704
|
// will be set by sphereDetail() or 1st call to sphere()
|
705
|
-
protected float
|
705
|
+
protected float[] sphereX;
|
706
|
+
protected float[] sphereY;
|
707
|
+
protected float[] sphereZ;
|
706
708
|
|
707
709
|
/// Number of U steps (aka "theta") around longitudinally spanning 2*pi
|
708
710
|
public int sphereDetailU = 0;
|
@@ -737,9 +739,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
737
739
|
|
738
740
|
|
739
741
|
/**
|
740
|
-
* Set (or unset) this as the main drawing surface.
|
741
|
-
|
742
|
-
|
742
|
+
* Set (or unset) this as the main drawing surface.Meaning that it can
|
743
|
+
safely be set to opaque (and given a default gray background), or anything
|
744
|
+
else that goes along with that.
|
745
|
+
* @param primary
|
743
746
|
*/
|
744
747
|
public void setPrimary(boolean primary) { // ignore
|
745
748
|
this.primaryGraphics = primary;
|
@@ -764,15 +767,14 @@ public class PGraphics extends PImage implements PConstants {
|
|
764
767
|
|
765
768
|
|
766
769
|
/**
|
767
|
-
* The final step in setting up a renderer, set its size of this renderer.
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
*
|
774
|
-
*
|
775
|
-
* animation thread.
|
770
|
+
* The final step in setting up a renderer, set its size of this renderer.This was formerly handled by the constructor, but instead it's been broken
|
771
|
+
out so that setParent/setPrimary/setPath can be handled differently.Important: this is ignored by the Methods task because otherwise it will
|
772
|
+
override setSize() in PApplet/Applet/Component, which will 1) not call
|
773
|
+
super.setSize(), and 2) will cause the renderer to be resized from the
|
774
|
+
event thread (EDT), causing a nasty crash as it collides with the
|
775
|
+
animation thread.
|
776
|
+
* @param w
|
777
|
+
* @param h
|
776
778
|
*/
|
777
779
|
public void setSize(int w, int h) { // ignore
|
778
780
|
width = w;
|
@@ -841,10 +843,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
841
843
|
|
842
844
|
|
843
845
|
/**
|
844
|
-
* Get cache storage data for the specified renderer.
|
845
|
-
|
846
|
-
|
847
|
-
|
846
|
+
* Get cache storage data for the specified renderer.Because each renderer
|
847
|
+
will cache data in different formats, it's necessary to store cache data
|
848
|
+
keyed by the renderer object. Otherwise, attempting to draw the same
|
849
|
+
image to both a PGraphicsJava2D and a PGraphicsOpenGL will cause errors.
|
850
|
+
* @param image
|
848
851
|
* @return metadata stored for the specified renderer
|
849
852
|
*/
|
850
853
|
public Object getCache(PImage image) { // ignore
|
@@ -1235,8 +1238,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
1235
1238
|
|
1236
1239
|
|
1237
1240
|
/**
|
1238
|
-
* Sets whether the upcoming vertex is part of an edge.
|
1239
|
-
*
|
1241
|
+
* Sets whether the upcoming vertex is part of an edge.Equivalent to glEdgeFlag(), for people familiar with OpenGL.
|
1242
|
+
* @param edge
|
1240
1243
|
*/
|
1241
1244
|
public void edge(boolean edge) {
|
1242
1245
|
this.edge = edge;
|
@@ -1388,7 +1391,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1388
1391
|
|
1389
1392
|
protected void vertexCheck() {
|
1390
1393
|
if (vertexCount == vertices.length) {
|
1391
|
-
float
|
1394
|
+
float[][] temp = new float[vertexCount << 1][VERTEX_FIELD_COUNT];
|
1392
1395
|
System.arraycopy(vertices, 0, temp, 0, vertexCount);
|
1393
1396
|
vertices = temp;
|
1394
1397
|
}
|
@@ -1480,7 +1483,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1480
1483
|
// http://dev.processing.org/bugs/show_bug.cgi?id=444
|
1481
1484
|
if (shape == POLYGON) {
|
1482
1485
|
if (vertexCount > 0) {
|
1483
|
-
float
|
1486
|
+
float[] pvertex = vertices[vertexCount-1];
|
1484
1487
|
if ((Math.abs(pvertex[X] - x) < EPSILON) &&
|
1485
1488
|
(Math.abs(pvertex[Y] - y) < EPSILON) &&
|
1486
1489
|
(Math.abs(pvertex[Z] - z) < EPSILON)) {
|
@@ -1647,18 +1650,18 @@ public class PGraphics extends PImage implements PConstants {
|
|
1647
1650
|
|
1648
1651
|
|
1649
1652
|
/**
|
1650
|
-
* Set (U, V) coords for the next vertex in the current shape.
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
* param of and overloaded vertex().
|
1655
|
-
*
|
1653
|
+
* Set (U, V) coords for the next vertex in the current shape.This is ugly as its own function, and will (almost?) always be
|
1654
|
+
coincident with a call to vertex.As of beta, this was moved to
|
1655
|
+
the protected method you see here, and called from an optional
|
1656
|
+
param of and overloaded vertex().
|
1656
1657
|
* The parameters depend on the current textureMode. When using
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1658
|
+
textureMode(IMAGE), the coordinates will be relative to the size
|
1659
|
+
of the image texture, when used with textureMode(NORMAL),
|
1660
|
+
they'll be in the range 0..1.
|
1661
|
+
|
1662
|
+
Used by both PGraphics2D (for images) and PGraphics3D.
|
1663
|
+
* @param u
|
1664
|
+
* @param v
|
1662
1665
|
*/
|
1663
1666
|
protected void vertexTexture(float u, float v) {
|
1664
1667
|
if (textureImage == null) {
|
@@ -1735,6 +1738,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1735
1738
|
|
1736
1739
|
|
1737
1740
|
/**
|
1741
|
+
* @return
|
1738
1742
|
* @webref shape
|
1739
1743
|
* @param filename name of file to load, can be .svg or .obj
|
1740
1744
|
* @see PShape
|
@@ -2732,11 +2736,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
2732
2736
|
/**
|
2733
2737
|
* ( begin auto-generated from square.xml )
|
2734
2738
|
*
|
2735
|
-
* Draws a square to the screen. A square is a four-sided shape with
|
2736
|
-
* every angle at ninety degrees and each side is the same length.
|
2737
|
-
* By default, the first two parameters set the location of the
|
2738
|
-
* upper-left corner, the third sets the width and height. The way
|
2739
|
-
* these parameters are interpreted, however, may be changed with the
|
2739
|
+
* Draws a square to the screen. A square is a four-sided shape with
|
2740
|
+
* every angle at ninety degrees and each side is the same length.
|
2741
|
+
* By default, the first two parameters set the location of the
|
2742
|
+
* upper-left corner, the third sets the width and height. The way
|
2743
|
+
* these parameters are interpreted, however, may be changed with the
|
2740
2744
|
* <b>rectMode()</b> function.
|
2741
2745
|
*
|
2742
2746
|
* ( end auto-generated )
|
@@ -2931,9 +2935,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
2931
2935
|
/**
|
2932
2936
|
* ( begin auto-generated from circle.xml )
|
2933
2937
|
*
|
2934
|
-
* Draws a circle to the screen. By default, the first two parameters
|
2935
|
-
* set the location of the center, and the third sets the shape's width
|
2936
|
-
* and height. The origin may be changed with the <b>ellipseMode()</b>
|
2938
|
+
* Draws a circle to the screen. By default, the first two parameters
|
2939
|
+
* set the location of the center, and the third sets the shape's width
|
2940
|
+
* and height. The origin may be changed with the <b>ellipseMode()</b>
|
2937
2941
|
* function.
|
2938
2942
|
*
|
2939
2943
|
* ( end auto-generated )
|
@@ -3424,17 +3428,17 @@ public class PGraphics extends PImage implements PConstants {
|
|
3424
3428
|
* ( begin auto-generated from curvePoint.xml )
|
3425
3429
|
*
|
3426
3430
|
* Evalutes the curve at point t for points a, b, c, d. The parameter t
|
3427
|
-
* varies between 0 and 1, a and d are
|
3428
|
-
* the
|
3431
|
+
* varies between 0 and 1, a and d are the control points, and b and c are
|
3432
|
+
* the points on the curve. This can be done once with the x coordinates and a
|
3429
3433
|
* second time with the y coordinates to get the location of a curve at t.
|
3430
3434
|
*
|
3431
3435
|
* ( end auto-generated )
|
3432
3436
|
*
|
3433
3437
|
* @webref shape:curves
|
3434
|
-
* @param a coordinate of first point
|
3435
|
-
* @param b coordinate of
|
3436
|
-
* @param c coordinate of
|
3437
|
-
* @param d coordinate of
|
3438
|
+
* @param a coordinate of first control point
|
3439
|
+
* @param b coordinate of first point on the curve
|
3440
|
+
* @param c coordinate of second point on the curve
|
3441
|
+
* @param d coordinate of second control point
|
3438
3442
|
* @param t value between 0 and 1
|
3439
3443
|
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
|
3440
3444
|
* @see PGraphics#curveVertex(float, float)
|
@@ -3460,7 +3464,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3460
3464
|
*
|
3461
3465
|
* Calculates the tangent of a point on a curve. There's a good definition
|
3462
3466
|
* of <em><a href="http://en.wikipedia.org/wiki/Tangent"
|
3463
|
-
* target="new">tangent
|
3467
|
+
* target="new">tangent on Wikipedia</a></em>.
|
3464
3468
|
*
|
3465
3469
|
* ( end auto-generated )
|
3466
3470
|
*
|
@@ -4016,7 +4020,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4016
4020
|
* to <b>shapeMode(CORNERS)</b>, for example, will change the width and
|
4017
4021
|
* height parameters to define the x and y values of the opposite corner of
|
4018
4022
|
* the shape.
|
4019
|
-
|
4023
|
+
*
|
4020
4024
|
* Note complex shapes may draw awkwardly with P3D. This renderer does not
|
4021
4025
|
* yet support shapes that have holes or complicated breaks.
|
4022
4026
|
*
|
@@ -4551,7 +4555,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4551
4555
|
* Unlike the previous version that was inside PFont, this will
|
4552
4556
|
* return the size not of a 1 pixel font, but the actual current size.
|
4553
4557
|
*/
|
4554
|
-
protected float textWidthImpl(char buffer
|
4558
|
+
protected float textWidthImpl(char[] buffer, int start, int stop) {
|
4555
4559
|
float wide = 0;
|
4556
4560
|
for (int i = start; i < stop; i++) {
|
4557
4561
|
// could add kerning here, but it just ain't implemented
|
@@ -4575,7 +4579,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4575
4579
|
* with the <b>fill()</b> function. The text displays in relation to the
|
4576
4580
|
* <b>textAlign()</b> function, which gives the option to draw to the left,
|
4577
4581
|
* right, and center of the coordinates.
|
4578
|
-
|
4582
|
+
*
|
4579
4583
|
* The <b>x2</b> and <b>y2</b> parameters define a rectangular area to
|
4580
4584
|
* display within and may only be used with string data. For text drawn
|
4581
4585
|
* inside a rectangle, the coordinates are interpreted based on the current
|
@@ -5019,7 +5023,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5019
5023
|
* Handles placement of a text line, then calls textLineImpl
|
5020
5024
|
* to actually render at the specific point.
|
5021
5025
|
*/
|
5022
|
-
protected void textLineAlignImpl(char buffer
|
5026
|
+
protected void textLineAlignImpl(char[] buffer, int start, int stop,
|
5023
5027
|
float x, float y) {
|
5024
5028
|
if (textAlign == CENTER) {
|
5025
5029
|
x -= textWidthImpl(buffer, start, stop) / 2f;
|
@@ -5035,7 +5039,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5035
5039
|
/**
|
5036
5040
|
* Implementation of actual drawing for a line of text.
|
5037
5041
|
*/
|
5038
|
-
protected void textLineImpl(char buffer
|
5042
|
+
protected void textLineImpl(char[] buffer, int start, int stop,
|
5039
5043
|
float x, float y) {
|
5040
5044
|
for (int index = start; index < stop; index++) {
|
5041
5045
|
textCharImpl(buffer[index], x, y);
|
@@ -5167,28 +5171,28 @@ public class PGraphics extends PImage implements PConstants {
|
|
5167
5171
|
/**
|
5168
5172
|
* ( begin auto-generated from push.xml )
|
5169
5173
|
*
|
5170
|
-
* The <b>push()</b> function saves the current drawing style
|
5171
|
-
* settings and transformations, while <b>pop()</b> restores these
|
5172
|
-
* settings. Note that these functions are always used together.
|
5173
|
-
* They allow you to change the style and transformation settings
|
5174
|
-
* and later return to what you had. When a new state is started
|
5175
|
-
* with push(), it builds on the current style and transform
|
5174
|
+
* The <b>push()</b> function saves the current drawing style
|
5175
|
+
* settings and transformations, while <b>pop()</b> restores these
|
5176
|
+
* settings. Note that these functions are always used together.
|
5177
|
+
* They allow you to change the style and transformation settings
|
5178
|
+
* and later return to what you had. When a new state is started
|
5179
|
+
* with push(), it builds on the current style and transform
|
5176
5180
|
* information.
|
5177
5181
|
*
|
5178
|
-
* <b>push()</b> stores information related to the current
|
5179
|
-
* transformation state and style settings controlled by the
|
5180
|
-
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
5181
|
-
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
|
5182
|
-
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
|
5183
|
-
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5184
|
-
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5182
|
+
* <b>push()</b> stores information related to the current
|
5183
|
+
* transformation state and style settings controlled by the
|
5184
|
+
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
5185
|
+
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
|
5186
|
+
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
|
5187
|
+
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5188
|
+
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5185
5189
|
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.
|
5186
5190
|
*
|
5187
|
-
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5188
|
-
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5189
|
-
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
5190
|
-
* The difference is that push() and pop() control both the
|
5191
|
-
* transformations (rotate, scale, translate) and the drawing styles
|
5191
|
+
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5192
|
+
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5193
|
+
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
5194
|
+
* The difference is that push() and pop() control both the
|
5195
|
+
* transformations (rotate, scale, translate) and the drawing styles
|
5192
5196
|
* at the same time.
|
5193
5197
|
*
|
5194
5198
|
* ( end auto-generated )
|
@@ -5204,28 +5208,28 @@ public class PGraphics extends PImage implements PConstants {
|
|
5204
5208
|
/**
|
5205
5209
|
* ( begin auto-generated from pop.xml )
|
5206
5210
|
*
|
5207
|
-
* The <b>pop()</b> function restores the previous drawing style
|
5208
|
-
* settings and transformations after <b>push()</b> has changed them.
|
5209
|
-
* Note that these functions are always used together. They allow
|
5210
|
-
* you to change the style and transformation settings and later
|
5211
|
-
* return to what you had. When a new state is started with push(),
|
5211
|
+
* The <b>pop()</b> function restores the previous drawing style
|
5212
|
+
* settings and transformations after <b>push()</b> has changed them.
|
5213
|
+
* Note that these functions are always used together. They allow
|
5214
|
+
* you to change the style and transformation settings and later
|
5215
|
+
* return to what you had. When a new state is started with push(),
|
5212
5216
|
* it builds on the current style and transform information.
|
5213
5217
|
*
|
5214
5218
|
*
|
5215
|
-
* <b>push()</b> stores information related to the current
|
5216
|
-
* transformation state and style settings controlled by the
|
5217
|
-
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
5218
|
-
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
|
5219
|
-
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
|
5220
|
-
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5221
|
-
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5219
|
+
* <b>push()</b> stores information related to the current
|
5220
|
+
* transformation state and style settings controlled by the
|
5221
|
+
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
5222
|
+
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
|
5223
|
+
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
|
5224
|
+
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5225
|
+
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5222
5226
|
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.
|
5223
5227
|
*
|
5224
|
-
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5225
|
-
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5226
|
-
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
5227
|
-
* The difference is that push() and pop() control both the
|
5228
|
-
* transformations (rotate, scale, translate) and the drawing styles
|
5228
|
+
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5229
|
+
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5230
|
+
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
5231
|
+
* The difference is that push() and pop() control both the
|
5232
|
+
* transformations (rotate, scale, translate) and the drawing styles
|
5229
5233
|
* at the same time.
|
5230
5234
|
*
|
5231
5235
|
* ( end auto-generated )
|
@@ -5799,15 +5803,15 @@ public class PGraphics extends PImage implements PConstants {
|
|
5799
5803
|
* The <b>beginCamera()</b> and <b>endCamera()</b> functions enable
|
5800
5804
|
* advanced customization of the camera space. The functions are useful if
|
5801
5805
|
* you want to more control over camera movement, however for most users,
|
5802
|
-
* the <b>camera()</b> function will be sufficient
|
5806
|
+
* the <b>camera()</b> function will be sufficient.The camera
|
5803
5807
|
* functions will replace any transformations (such as <b>rotate()</b> or
|
5804
5808
|
* <b>translate()</b>) that occur before them in <b>draw()</b>, but they
|
5805
5809
|
* will not automatically replace the camera transform itself. For this
|
5806
5810
|
* reason, camera functions should be placed at the beginning of
|
5807
5811
|
* <b>draw()</b> (so that transformations happen afterwards), and the
|
5808
5812
|
* <b>camera()</b> function can be used after <b>beginCamera()</b> if you
|
5809
|
-
* want to reset the camera before applying transformations
|
5810
|
-
*
|
5813
|
+
* want to reset the camera before applying transformations.
|
5814
|
+
* This function sets the matrix mode to the camera matrix so calls such
|
5811
5815
|
* as <b>translate()</b>, <b>rotate()</b>, applyMatrix() and resetMatrix()
|
5812
5816
|
* affect the camera. <b>beginCamera()</b> should always be used with a
|
5813
5817
|
* following <b>endCamera()</b> and pairs of <b>beginCamera()</b> and
|
@@ -6069,6 +6073,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6069
6073
|
|
6070
6074
|
/**
|
6071
6075
|
* @param z 3D z-coordinate to be mapped
|
6076
|
+
* @return
|
6072
6077
|
*/
|
6073
6078
|
public float screenX(float x, float y, float z) {
|
6074
6079
|
showMissingWarning("screenX");
|
@@ -6090,10 +6095,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
6090
6095
|
* ( begin auto-generated from screenZ.xml )
|
6091
6096
|
*
|
6092
6097
|
* Takes a three-dimensional X, Y, Z position and returns the Z value for
|
6093
|
-
* where it will appear on a (two-dimensional) screen.
|
6098
|
+
* where it will appear on a (two-dimensional) screen.( end auto-generated )
|
6094
6099
|
*
|
6095
|
-
* ( end auto-generated )
|
6096
6100
|
*
|
6101
|
+
* @return
|
6097
6102
|
* @webref lights_camera:coordinates
|
6098
6103
|
* @param x 3D x-coordinate to be mapped
|
6099
6104
|
* @param y 3D y-coordinate to be mapped
|
@@ -6110,13 +6115,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
6110
6115
|
/**
|
6111
6116
|
* ( begin auto-generated from modelX.xml )
|
6112
6117
|
*
|
6113
|
-
* Returns the three-dimensional X, Y, Z position in model space.
|
6114
|
-
|
6115
|
-
|
6116
|
-
|
6117
|
-
|
6118
|
-
*
|
6119
|
-
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6118
|
+
* Returns the three-dimensional X, Y, Z position in model space.This
|
6119
|
+
returns the X value for a given coordinate based on the current set of
|
6120
|
+
transformations (scale, rotate, translate, etc.) The X value can be used
|
6121
|
+
to place an object in space relative to the location of the original
|
6122
|
+
point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6120
6123
|
* <b>modelZ()</b> functions record the location of a box in space after
|
6121
6124
|
* being placed using a series of translate and rotate commands. After
|
6122
6125
|
* popMatrix() is called, those transformations no longer apply, but the
|
@@ -6125,6 +6128,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6125
6128
|
*
|
6126
6129
|
* ( end auto-generated )
|
6127
6130
|
*
|
6131
|
+
* @return
|
6128
6132
|
* @webref lights_camera:coordinates
|
6129
6133
|
* @param x 3D x-coordinate to be mapped
|
6130
6134
|
* @param y 3D y-coordinate to be mapped
|
@@ -6141,13 +6145,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
6141
6145
|
/**
|
6142
6146
|
* ( begin auto-generated from modelY.xml )
|
6143
6147
|
*
|
6144
|
-
* Returns the three-dimensional X, Y, Z position in model space.
|
6145
|
-
|
6146
|
-
|
6147
|
-
|
6148
|
-
|
6149
|
-
*
|
6150
|
-
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6148
|
+
* Returns the three-dimensional X, Y, Z position in model space.This
|
6149
|
+
returns the Y value for a given coordinate based on the current set of
|
6150
|
+
transformations (scale, rotate, translate, etc.) The Y value can be used
|
6151
|
+
to place an object in space relative to the location of the original
|
6152
|
+
point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6151
6153
|
* <b>modelZ()</b> functions record the location of a box in space after
|
6152
6154
|
* being placed using a series of translate and rotate commands. After
|
6153
6155
|
* popMatrix() is called, those transformations no longer apply, but the
|
@@ -6156,6 +6158,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6156
6158
|
*
|
6157
6159
|
* ( end auto-generated )
|
6158
6160
|
*
|
6161
|
+
* @return
|
6159
6162
|
* @webref lights_camera:coordinates
|
6160
6163
|
* @param x 3D x-coordinate to be mapped
|
6161
6164
|
* @param y 3D y-coordinate to be mapped
|
@@ -6172,13 +6175,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
6172
6175
|
/**
|
6173
6176
|
* ( begin auto-generated from modelZ.xml )
|
6174
6177
|
*
|
6175
|
-
* Returns the three-dimensional X, Y, Z position in model space.
|
6176
|
-
|
6177
|
-
|
6178
|
-
|
6179
|
-
|
6180
|
-
*
|
6181
|
-
* In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6178
|
+
* Returns the three-dimensional X, Y, Z position in model space.This
|
6179
|
+
returns the Z value for a given coordinate based on the current set of
|
6180
|
+
transformations (scale, rotate, translate, etc.) The Z value can be used
|
6181
|
+
to place an object in space relative to the location of the original
|
6182
|
+
point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
|
6182
6183
|
* <b>modelZ()</b> functions record the location of a box in space after
|
6183
6184
|
* being placed using a series of translate and rotate commands. After
|
6184
6185
|
* popMatrix() is called, those transformations no longer apply, but the
|
@@ -6187,6 +6188,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6187
6188
|
*
|
6188
6189
|
* ( end auto-generated )
|
6189
6190
|
*
|
6191
|
+
* @return
|
6190
6192
|
* @webref lights_camera:coordinates
|
6191
6193
|
* @param x 3D x-coordinate to be mapped
|
6192
6194
|
* @param y 3D y-coordinate to be mapped
|
@@ -6215,7 +6217,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6215
6217
|
* <b>pushStyle()</b>, it builds on the current style information. The
|
6216
6218
|
* <b>pushStyle()</b> and <b>popStyle()</b> functions can be embedded to
|
6217
6219
|
* provide more control (see the second example above for a demonstration.)
|
6218
|
-
|
6220
|
+
*
|
6219
6221
|
* The style information controlled by the following functions are included
|
6220
6222
|
* in the style:
|
6221
6223
|
* fill(), stroke(), tint(), strokeWeight(), strokeCap(), strokeJoin(),
|
@@ -6940,6 +6942,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
6940
6942
|
|
6941
6943
|
/**
|
6942
6944
|
* gray number specifying value between white and black
|
6945
|
+
*
|
6946
|
+
* @param gray value between black and white, by default 0 to 255
|
6943
6947
|
*/
|
6944
6948
|
public void specular(float gray) {
|
6945
6949
|
colorCalc(gray);
|
@@ -7017,6 +7021,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
7017
7021
|
|
7018
7022
|
/**
|
7019
7023
|
* gray number specifying value between white and black
|
7024
|
+
*
|
7025
|
+
* @param gray value between black and white, by default 0 to 255
|
7020
7026
|
*/
|
7021
7027
|
public void emissive(float gray) {
|
7022
7028
|
colorCalc(gray);
|
@@ -7243,9 +7249,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
7243
7249
|
*
|
7244
7250
|
* Sets the falloff rates for point lights, spot lights, and ambient
|
7245
7251
|
* lights. The parameters are used to determine the falloff with the
|
7246
|
-
* following equation
|
7252
|
+
* following equation:d = distance from light position to
|
7247
7253
|
* vertex positionfalloff = 1 / (CONSTANT + d * LINEAR + (d*d) *
|
7248
|
-
* QUADRATIC)
|
7254
|
+
* QUADRATIC)Like <b>fill()</b>, it affects only the elements
|
7249
7255
|
* which are created after it in the code. The default value if
|
7250
7256
|
* <b>LightFalloff(1.0, 0.0, 0.0)</b>. Thinking about an ambient light with
|
7251
7257
|
* a falloff can be tricky. It is used, for example, if you wanted a region
|
@@ -7904,7 +7910,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7904
7910
|
*
|
7905
7911
|
* Extracts the red value from a color, scaled to match current
|
7906
7912
|
* <b>colorMode()</b>. This value is always returned as a float so be
|
7907
|
-
* careful not to assign it to an int value
|
7913
|
+
* careful not to assign it to an int value.The red() function
|
7908
7914
|
* is easy to use and undestand, but is slower than another technique. To
|
7909
7915
|
* achieve the same results when working in <b>colorMode(RGB, 255)</b>, but
|
7910
7916
|
* with greater speed, use the >> (right shift) operator with a bit
|
@@ -7937,7 +7943,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7937
7943
|
*
|
7938
7944
|
* Extracts the green value from a color, scaled to match current
|
7939
7945
|
* <b>colorMode()</b>. This value is always returned as a float so be
|
7940
|
-
* careful not to assign it to an int value
|
7946
|
+
* careful not to assign it to an int value.The <b>green()</b>
|
7941
7947
|
* function is easy to use and undestand, but is slower than another
|
7942
7948
|
* technique. To achieve the same results when working in <b>colorMode(RGB,
|
7943
7949
|
* 255)</b>, but with greater speed, use the >> (right shift)
|
@@ -7970,7 +7976,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7970
7976
|
*
|
7971
7977
|
* Extracts the blue value from a color, scaled to match current
|
7972
7978
|
* <b>colorMode()</b>. This value is always returned as a float so be
|
7973
|
-
* careful not to assign it to an int value
|
7979
|
+
* careful not to assign it to an int value.The <b>blue()</b>
|
7974
7980
|
* function is easy to use and undestand, but is slower than another
|
7975
7981
|
* technique. To achieve the same results when working in <b>colorMode(RGB,
|
7976
7982
|
* 255)</b>, but with greater speed, use a bit mask to remove the other
|
@@ -8001,9 +8007,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
8001
8007
|
/**
|
8002
8008
|
* ( begin auto-generated from hue.xml )
|
8003
8009
|
*
|
8004
|
-
* Extracts the hue value from a color.
|
8010
|
+
* Extracts the hue value from a color.( end auto-generated )
|
8005
8011
|
*
|
8006
|
-
*
|
8012
|
+
* @return
|
8007
8013
|
* @webref color:creating_reading
|
8008
8014
|
* @usage web_application
|
8009
8015
|
* @param rgb any value of the color datatype
|
@@ -8027,9 +8033,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
8027
8033
|
/**
|
8028
8034
|
* ( begin auto-generated from saturation.xml )
|
8029
8035
|
*
|
8030
|
-
* Extracts the saturation value from a color.
|
8036
|
+
* Extracts the saturation value from a color.( end auto-generated )
|
8031
8037
|
*
|
8032
|
-
*
|
8038
|
+
* @return
|
8033
8039
|
* @webref color:creating_reading
|
8034
8040
|
* @usage web_application
|
8035
8041
|
* @param rgb any value of the color datatype
|
@@ -8053,10 +8059,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
8053
8059
|
/**
|
8054
8060
|
* ( begin auto-generated from brightness.xml )
|
8055
8061
|
*
|
8056
|
-
* Extracts the brightness value from a color.
|
8062
|
+
* Extracts the brightness value from a color.( end auto-generated )
|
8057
8063
|
*
|
8058
|
-
* ( end auto-generated )
|
8059
8064
|
*
|
8065
|
+
* @return
|
8060
8066
|
* @webref color:creating_reading
|
8061
8067
|
* @usage web_application
|
8062
8068
|
* @param rgb any value of the color datatype
|
@@ -8192,6 +8198,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8192
8198
|
|
8193
8199
|
/**
|
8194
8200
|
* Record individual lines and triangles by echoing them to another renderer.
|
8201
|
+
* @param rawGraphics
|
8195
8202
|
*/
|
8196
8203
|
public void beginRaw(PGraphics rawGraphics) { // ignore
|
8197
8204
|
this.raw = rawGraphics;
|
@@ -8249,6 +8256,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
8249
8256
|
|
8250
8257
|
/**
|
8251
8258
|
* Version of showWarning() that takes a parsed String.
|
8259
|
+
* @param msg
|
8260
|
+
* @param args
|
8252
8261
|
*/
|
8253
8262
|
static public void showWarning(String msg, Object... args) { // ignore
|
8254
8263
|
showWarning(String.format(msg, args));
|
@@ -8280,6 +8289,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8280
8289
|
|
8281
8290
|
/**
|
8282
8291
|
* Display a warning that the specified method is simply unavailable.
|
8292
|
+
* @param method
|
8283
8293
|
*/
|
8284
8294
|
static public void showMethodWarning(String method) {
|
8285
8295
|
showWarning(method + "() is not available with this renderer.");
|
@@ -8288,8 +8298,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
8288
8298
|
|
8289
8299
|
/**
|
8290
8300
|
* Error that a particular variation of a method is unavailable (even though
|
8291
|
-
* other variations are).
|
8292
|
-
|
8301
|
+
* other variations are).For instance, if vertex(x, y, u, v) is not
|
8302
|
+
available, but vertex(x, y) is just fine.
|
8303
|
+
* @param str
|
8293
8304
|
*/
|
8294
8305
|
static public void showVariationWarning(String str) {
|
8295
8306
|
showWarning(str + " is not available with this renderer.");
|
@@ -8300,6 +8311,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8300
8311
|
* Display a warning that the specified method is not implemented, meaning
|
8301
8312
|
* that it could be either a completely missing function, although other
|
8302
8313
|
* variations of it may still work properly.
|
8314
|
+
* @param method
|
8303
8315
|
*/
|
8304
8316
|
static public void showMissingWarning(String method) {
|
8305
8317
|
showWarning(method + "(), or this particular variation of it, " +
|
@@ -8308,9 +8320,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
8308
8320
|
|
8309
8321
|
|
8310
8322
|
/**
|
8311
|
-
* Show an renderer-related exception that halts the program.
|
8312
|
-
|
8313
|
-
|
8323
|
+
* Show an renderer-related exception that halts the program.Currently just
|
8324
|
+
wraps the message as a RuntimeException and throws it, but might do
|
8325
|
+
something more specific might be used in the future.
|
8326
|
+
* @param msg
|
8314
8327
|
*/
|
8315
8328
|
static public void showException(String msg) { // ignore
|
8316
8329
|
throw new RuntimeException(msg);
|
@@ -8319,6 +8332,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8319
8332
|
|
8320
8333
|
/**
|
8321
8334
|
* Same as below, but defaults to a 12 point font, just as MacWrite intended.
|
8335
|
+
* @param method
|
8322
8336
|
*/
|
8323
8337
|
protected void defaultFontOrDeath(String method) {
|
8324
8338
|
defaultFontOrDeath(method, 12);
|
@@ -8329,6 +8343,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
8329
8343
|
* First try to create a default font, but if that's not possible, throw
|
8330
8344
|
* an exception that halts the program because textFont() has not been used
|
8331
8345
|
* prior to the specified method.
|
8346
|
+
* @param method
|
8347
|
+
* @param size
|
8332
8348
|
*/
|
8333
8349
|
protected void defaultFontOrDeath(String method, float size) {
|
8334
8350
|
if (parent != null) {
|