picrate 2.1.2-java → 2.4.2-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/CHANGELOG.md +8 -0
- data/README.md +3 -2
- data/Rakefile +2 -1
- data/docs/_includes/footer.html +1 -1
- data/docs/_layouts/post.html +1 -1
- data/docs/_methods/noise_mode.md +88 -0
- data/docs/_posts/2018-05-06-install_jruby.md +1 -1
- data/docs/_posts/2018-11-18-building-gem.md +3 -1
- data/docs/classes.md +2 -2
- data/docs/editors.md +2 -2
- data/docs/gems.md +3 -3
- data/docs/index.html +1 -1
- data/docs/libraries.md +2 -2
- data/docs/live.md +2 -2
- data/docs/magic.md +2 -2
- data/docs/methods.md +2 -2
- data/docs/modules.md +3 -3
- data/docs/objects.md +2 -2
- data/lib/picrate/app.rb +7 -6
- data/lib/picrate/native_folder.rb +1 -3
- data/lib/picrate/version.rb +1 -1
- data/library/pdf/pdf.rb +7 -0
- data/library/svg/svg.rb +7 -0
- data/picrate.gemspec +5 -3
- data/pom.rb +25 -4
- data/pom.xml +39 -4
- data/src/main/java/monkstone/FastNoiseModuleJava.java +127 -0
- data/src/main/java/monkstone/PicrateLibrary.java +3 -1
- data/src/main/java/monkstone/SmoothNoiseModuleJava.java +127 -0
- data/src/main/java/monkstone/fastmath/DegLutTables.java +111 -0
- data/src/main/java/monkstone/fastmath/Deglut.java +41 -93
- data/src/main/java/monkstone/noise/OpenSimplex2F.java +914 -0
- data/src/main/java/monkstone/noise/OpenSimplex2S.java +1138 -0
- data/src/main/java/monkstone/vecmath/package-info.java +1 -1
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -1
- data/src/main/java/monkstone/videoevent/package-info.java +1 -1
- data/src/main/java/processing/awt/ShimAWT.java +260 -94
- data/src/main/java/processing/core/PApplet.java +14664 -13450
- data/src/main/java/processing/core/PConstants.java +5 -5
- data/src/main/java/processing/core/PFont.java +1 -1
- data/src/main/java/processing/core/PGraphics.java +200 -201
- data/src/main/java/processing/core/PImage.java +539 -549
- data/src/main/java/processing/core/PShape.java +18 -18
- data/src/main/java/processing/core/PVector.java +23 -23
- data/src/main/java/processing/data/Table.java +4 -4
- data/src/main/java/processing/net/Client.java +13 -13
- data/src/main/java/processing/net/Server.java +5 -5
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +4 -4
- data/src/main/java/processing/pdf/PGraphicsPDF.java +529 -0
- data/src/main/java/processing/svg/PGraphicsSVG.java +378 -0
- data/test/deglut_spec_test.rb +2 -2
- data/test/respond_to_test.rb +0 -2
- data/test/test_helper.rb +1 -1
- data/vendors/Rakefile +1 -1
- metadata +26 -15
- data/src/main/java/monkstone/noise/SimplexNoise.java +0 -465
@@ -207,7 +207,7 @@ public interface PConstants {
|
|
207
207
|
* useful in combination with the trigonometric functions <b>sin()</b> and
|
208
208
|
* <b>cos()</b>.
|
209
209
|
*
|
210
|
-
|
210
|
+
|
211
211
|
*
|
212
212
|
* @webref constants
|
213
213
|
* @see PConstants#TWO_PI
|
@@ -225,7 +225,7 @@ public interface PConstants {
|
|
225
225
|
* is useful in combination with the trigonometric functions <b>sin()</b>
|
226
226
|
* and <b>cos()</b>.
|
227
227
|
*
|
228
|
-
|
228
|
+
|
229
229
|
*
|
230
230
|
* @webref constants
|
231
231
|
* @see PConstants#PI
|
@@ -247,7 +247,7 @@ public interface PConstants {
|
|
247
247
|
* useful in combination with the trigonometric functions
|
248
248
|
* <b>sin()</b> and <b>cos()</b>.
|
249
249
|
*
|
250
|
-
|
250
|
+
|
251
251
|
*
|
252
252
|
* @webref constants
|
253
253
|
* @see PConstants#PI
|
@@ -264,7 +264,7 @@ public interface PConstants {
|
|
264
264
|
* It is useful in combination with the trigonometric functions
|
265
265
|
* <b>sin()</b> and <b>cos()</b>.
|
266
266
|
*
|
267
|
-
|
267
|
+
|
268
268
|
*
|
269
269
|
* @webref constants
|
270
270
|
* @see PConstants#PI
|
@@ -281,7 +281,7 @@ public interface PConstants {
|
|
281
281
|
* circle to its diameter. It is useful in combination with the
|
282
282
|
* trigonometric functions <b>sin()</b> and <b>cos()</b>.
|
283
283
|
*
|
284
|
-
|
284
|
+
|
285
285
|
*
|
286
286
|
* @webref constants
|
287
287
|
* @see PConstants#PI
|
@@ -186,7 +186,7 @@ public class PFont implements PConstants {
|
|
186
186
|
* <b>createFont()</b> function for dynamically converting fonts into a format
|
187
187
|
* to use with Processing.
|
188
188
|
*
|
189
|
-
|
189
|
+
|
190
190
|
*
|
191
191
|
* @nowebref
|
192
192
|
* @param font font the font object to create from
|
@@ -45,7 +45,6 @@ import java.util.concurrent.Executors;
|
|
45
45
|
import java.util.concurrent.Future;
|
46
46
|
import java.util.concurrent.RejectedExecutionException;
|
47
47
|
import java.util.concurrent.TimeUnit;
|
48
|
-
|
49
48
|
import processing.opengl.PGL;
|
50
49
|
import processing.opengl.PShader;
|
51
50
|
|
@@ -61,7 +60,7 @@ import processing.opengl.PShader;
|
|
61
60
|
* methods for this class are extensive. For a complete list, visit the <a
|
62
61
|
* href="http://processing.googlecode.com/svn/trunk/processing/build/javadoc/core/">developer's reference.</a>
|
63
62
|
*
|
64
|
-
|
63
|
+
|
65
64
|
*
|
66
65
|
* <h3>Advanced</h3>
|
67
66
|
* Main graphics and rendering context, as well as the base API implementation.
|
@@ -174,7 +173,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
174
173
|
|
175
174
|
/// the anti-aliasing level for renderers that support it
|
176
175
|
public int smooth;
|
177
|
-
|
176
|
+
|
178
177
|
|
179
178
|
// ........................................................
|
180
179
|
|
@@ -207,12 +206,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
207
206
|
/**
|
208
207
|
* Array of hint[] items. These are hacks to get around various
|
209
208
|
* temporary workarounds inside the environment.
|
210
|
-
*
|
209
|
+
*
|
211
210
|
* Note that this array cannot be static, as a hint() may result in a
|
212
211
|
* runtime change specific to a renderer. For instance, calling
|
213
212
|
* hint(DISABLE_DEPTH_TEST) has to call glDisable() right away on an
|
214
213
|
* instance of PGraphicsOpenGL.
|
215
|
-
*
|
214
|
+
*
|
216
215
|
* The hints[] array is allocated early on because it might
|
217
216
|
* be used inside beginDraw(), allocate(), etc.
|
218
217
|
*/
|
@@ -618,18 +617,18 @@ public class PGraphics extends PImage implements PConstants {
|
|
618
617
|
// [toxi 031031]
|
619
618
|
// changed table's precision to 0.5 degree steps
|
620
619
|
// introduced new vars for more flexible code
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
620
|
+
static final protected float[] sinLUT;
|
621
|
+
static final protected float[] cosLUT;
|
622
|
+
static final protected float SINCOS_PRECISION = 0.5f;
|
623
|
+
static final protected int SINCOS_LENGTH = (int) (360f / SINCOS_PRECISION);
|
624
|
+
static {
|
625
|
+
sinLUT = new float[SINCOS_LENGTH];
|
626
|
+
cosLUT = new float[SINCOS_LENGTH];
|
627
|
+
for (int i = 0; i < SINCOS_LENGTH; i++) {
|
628
|
+
sinLUT[i] = (float) Math.sin(Math.toRadians(i * SINCOS_PRECISION));
|
629
|
+
cosLUT[i] = (float) Math.cos(Math.toRadians(i * SINCOS_PRECISION));
|
630
|
+
}
|
631
|
+
}
|
633
632
|
|
634
633
|
// ........................................................
|
635
634
|
|
@@ -894,7 +893,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
894
893
|
* Sets the default properties for a PGraphics object. It should be called
|
895
894
|
* before anything is drawn into the object.
|
896
895
|
*
|
897
|
-
|
896
|
+
|
898
897
|
* <h3>Advanced</h3>
|
899
898
|
* When creating your own PGraphics, you should call this before
|
900
899
|
* drawing anything.
|
@@ -911,9 +910,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
911
910
|
*
|
912
911
|
* Finalizes the rendering of a PGraphics object so that it can be shown on screen.
|
913
912
|
*
|
914
|
-
|
913
|
+
|
915
914
|
* <h3>Advanced</h3>
|
916
|
-
*
|
915
|
+
*
|
917
916
|
* When creating your own PGraphics, you should call this when
|
918
917
|
* you're finished drawing.
|
919
918
|
*
|
@@ -1090,7 +1089,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1090
1089
|
* obscure rendering features that cannot be implemented in a consistent
|
1091
1090
|
* manner across renderers. Many options will often graduate to standard
|
1092
1091
|
* features instead of hints over time.
|
1093
|
-
*
|
1092
|
+
*
|
1094
1093
|
* hint(ENABLE_OPENGL_4X_SMOOTH) - Enable 4x anti-aliasing for P3D. This
|
1095
1094
|
* can help force anti-aliasing if it has not been enabled by the user. On
|
1096
1095
|
* some graphics cards, this can also be set by the graphics driver's
|
@@ -1098,13 +1097,13 @@ public class PGraphics extends PImage implements PConstants {
|
|
1098
1097
|
* be called immediately after the size() command because it resets the
|
1099
1098
|
* renderer, obliterating any settings and anything drawn (and like size(),
|
1100
1099
|
* re-running the code that came before it again).
|
1101
|
-
*
|
1100
|
+
*
|
1102
1101
|
* hint(DISABLE_OPENGL_2X_SMOOTH) - In Processing 1.0, Processing always
|
1103
1102
|
* enables 2x smoothing when the P3D renderer is used. This hint disables
|
1104
1103
|
* the default 2x smoothing and returns the smoothing behavior found in
|
1105
1104
|
* earlier releases, where smooth() and noSmooth() could be used to enable
|
1106
1105
|
* and disable smoothing, though the quality was inferior.
|
1107
|
-
*
|
1106
|
+
*
|
1108
1107
|
* hint(ENABLE_NATIVE_FONTS) - Use the native version fonts when they are
|
1109
1108
|
* installed, rather than the bitmapped version from a .vlw file. This is
|
1110
1109
|
* useful with the default (or JAVA2D) renderer setting, as it will improve
|
@@ -1113,7 +1112,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1113
1112
|
* machine (because you have the font installed) but lousy on others'
|
1114
1113
|
* machines if the identical font is unavailable. This option can only be
|
1115
1114
|
* set per-sketch, and must be called before any use of textFont().
|
1116
|
-
*
|
1115
|
+
*
|
1117
1116
|
* hint(DISABLE_DEPTH_TEST) - Disable the zbuffer, allowing you to draw on
|
1118
1117
|
* top of everything at will. When depth testing is disabled, items will be
|
1119
1118
|
* drawn to the screen sequentially, like a painting. This hint is most
|
@@ -1123,14 +1122,14 @@ public class PGraphics extends PImage implements PConstants {
|
|
1123
1122
|
* hint(ENABLE_DEPTH_TEST), but note that with the depth buffer cleared,
|
1124
1123
|
* any 3D drawing that happens later in draw() will ignore existing shapes
|
1125
1124
|
* on the screen.
|
1126
|
-
*
|
1125
|
+
*
|
1127
1126
|
* hint(ENABLE_DEPTH_SORT) - Enable primitive z-sorting of triangles and
|
1128
1127
|
* lines in P3D and OPENGL. This can slow performance considerably, and the
|
1129
1128
|
* algorithm is not yet perfect. Restore the default with hint(DISABLE_DEPTH_SORT).
|
1130
|
-
*
|
1129
|
+
*
|
1131
1130
|
* hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the P3D renderer setting
|
1132
1131
|
* by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
|
1133
|
-
*
|
1132
|
+
*
|
1134
1133
|
* hint(ENABLE_BUFFER_READING) - Depth and stencil buffers in P2D/P3D will be
|
1135
1134
|
* downsampled to make PGL#readPixels work with multisampling. Enabling this
|
1136
1135
|
* introduces some overhead, so if you experience bad performance, disable
|
@@ -1139,23 +1138,23 @@ public class PGraphics extends PImage implements PConstants {
|
|
1139
1138
|
* creating your PGraphics2D/3D. You can restore the default with
|
1140
1139
|
* hint(DISABLE_BUFFER_READING) if you don't plan to read depth from
|
1141
1140
|
* this PGraphics anymore.
|
1142
|
-
*
|
1141
|
+
*
|
1143
1142
|
* hint(ENABLE_KEY_REPEAT) - Auto-repeating key events are discarded
|
1144
1143
|
* by default (works only in P2D/P3D); use this hint to get all the key events
|
1145
1144
|
* (including auto-repeated). Call hint(DISABLE_KEY_REPEAT) to get events
|
1146
1145
|
* only when the key goes physically up or down.
|
1147
|
-
*
|
1146
|
+
*
|
1148
1147
|
* hint(DISABLE_ASYNC_SAVEFRAME) - P2D/P3D only - save() and saveFrame()
|
1149
1148
|
* will not use separate threads for saving and will block until the image
|
1150
1149
|
* is written to the drive. This was the default behavior in 3.0b7 and before.
|
1151
1150
|
* To enable, call hint(ENABLE_ASYNC_SAVEFRAME).
|
1152
|
-
*
|
1151
|
+
*
|
1153
1152
|
* As of release 0149, unhint() has been removed in favor of adding
|
1154
1153
|
* additional ENABLE/DISABLE constants to reset the default behavior. This
|
1155
|
-
* prevents the
|
1154
|
+
* prevents the float negatives, and also reinforces which hints can be
|
1156
1155
|
* enabled or disabled.
|
1157
1156
|
*
|
1158
|
-
|
1157
|
+
|
1159
1158
|
*
|
1160
1159
|
* @webref rendering
|
1161
1160
|
* @param which name of the hint to be enabled or disabled
|
@@ -1211,19 +1210,19 @@ public class PGraphics extends PImage implements PConstants {
|
|
1211
1210
|
* specifies a position in 2D and the <b>vertex()</b> function with three
|
1212
1211
|
* parameters specifies a position in 3D. Each shape will be outlined with
|
1213
1212
|
* the current stroke color and filled with the fill color.
|
1214
|
-
*
|
1213
|
+
*
|
1215
1214
|
* Transformations such as <b>translate()</b>, <b>rotate()</b>, and
|
1216
1215
|
* <b>scale()</b> do not work within <b>beginShape()</b>. It is also not
|
1217
1216
|
* possible to use other shapes, such as <b>ellipse()</b> or <b>rect()</b>
|
1218
1217
|
* within <b>beginShape()</b>.
|
1219
|
-
*
|
1218
|
+
*
|
1220
1219
|
* The P3D renderer settings allow <b>stroke()</b> and <b>fill()</b>
|
1221
1220
|
* settings to be altered per-vertex, however the default P2D renderer does
|
1222
1221
|
* not. Settings such as <b>strokeWeight()</b>, <b>strokeCap()</b>, and
|
1223
1222
|
* <b>strokeJoin()</b> cannot be changed while inside a
|
1224
1223
|
* <b>beginShape()</b>/<b>endShape()</b> block with any renderer.
|
1225
1224
|
*
|
1226
|
-
|
1225
|
+
|
1227
1226
|
* @webref shape:vertex
|
1228
1227
|
* @param kind Either POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, or QUAD_STRIP
|
1229
1228
|
* @see PShape
|
@@ -1256,7 +1255,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1256
1255
|
* imperfect, this is a better option when you want more control. This
|
1257
1256
|
* function is identical to glNormal3f() in OpenGL.
|
1258
1257
|
*
|
1259
|
-
|
1258
|
+
|
1260
1259
|
* @webref lights_camera:lights
|
1261
1260
|
* @param nx x direction
|
1262
1261
|
* @param ny y direction
|
@@ -1325,7 +1324,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1325
1324
|
* the points (0,0) (0,100) (100,200) (0,200). The same mapping in
|
1326
1325
|
* NORMAL_SPACE is (0,0) (0,1) (1,1) (0,1).
|
1327
1326
|
*
|
1328
|
-
|
1327
|
+
|
1329
1328
|
* @webref image:textures
|
1330
1329
|
* @param mode either IMAGE or NORMAL
|
1331
1330
|
* @see PGraphics#texture(PImage)
|
@@ -1361,11 +1360,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
1361
1360
|
* Sets a texture to be applied to vertex points. The <b>texture()</b>
|
1362
1361
|
* function must be called between <b>beginShape()</b> and
|
1363
1362
|
* <b>endShape()</b> and before any calls to <b>vertex()</b>.
|
1364
|
-
*
|
1363
|
+
*
|
1365
1364
|
* When textures are in use, the fill color is ignored. Instead, use tint()
|
1366
1365
|
* to specify the color of the texture as it is applied to the shape.
|
1367
1366
|
*
|
1368
|
-
|
1367
|
+
|
1369
1368
|
* @webref image:textures
|
1370
1369
|
* @param image reference to a PImage object
|
1371
1370
|
* @see PGraphics#textureMode(int)
|
@@ -1609,10 +1608,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
1609
1608
|
* <b>vertex()</b> is used to specify the vertex coordinates for points,
|
1610
1609
|
* lines, triangles, quads, and polygons and is used exclusively within the
|
1611
1610
|
* <b>beginShape()</b> and <b>endShape()</b> function.
|
1612
|
-
*
|
1611
|
+
*
|
1613
1612
|
* Drawing a vertex in 3D using the <b>z</b> parameter requires the P3D
|
1614
1613
|
* parameter in combination with size as shown in the above example.
|
1615
|
-
*
|
1614
|
+
*
|
1616
1615
|
* This function is also used to map a texture onto the geometry. The
|
1617
1616
|
* <b>texture()</b> function declares the texture to apply to the geometry
|
1618
1617
|
* and the <b>u</b> and <b>v</b> coordinates set define the mapping of this
|
@@ -1620,7 +1619,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1620
1619
|
* <b>v</b> are specified in relation to the image's size in pixels, but
|
1621
1620
|
* this relation can be changed with <b>textureMode()</b>.
|
1622
1621
|
*
|
1623
|
-
|
1622
|
+
|
1624
1623
|
* @webref shape:vertex
|
1625
1624
|
* @param x x-coordinate of the vertex
|
1626
1625
|
* @param y y-coordinate of the vertex
|
@@ -1658,7 +1657,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1658
1657
|
textureMode(IMAGE), the coordinates will be relative to the size
|
1659
1658
|
of the image texture, when used with textureMode(NORMAL),
|
1660
1659
|
they'll be in the range 0..1.
|
1661
|
-
|
1660
|
+
|
1662
1661
|
Used by both PGraphics2D (for images) and PGraphics3D.
|
1663
1662
|
* @param u
|
1664
1663
|
* @param v
|
@@ -1721,7 +1720,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1721
1720
|
* as the value for the MODE parameter to close the shape (to connect the
|
1722
1721
|
* beginning and the end).
|
1723
1722
|
*
|
1724
|
-
|
1723
|
+
|
1725
1724
|
* @webref shape:vertex
|
1726
1725
|
* @param mode use CLOSE to close the shape
|
1727
1726
|
* @see PShape
|
@@ -1738,7 +1737,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1738
1737
|
|
1739
1738
|
|
1740
1739
|
/**
|
1741
|
-
* @return
|
1740
|
+
* @return
|
1742
1741
|
* @webref shape
|
1743
1742
|
* @param filename name of file to load, can be .svg or .obj
|
1744
1743
|
* @see PShape
|
@@ -1890,7 +1889,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1890
1889
|
*
|
1891
1890
|
* This is a new reference entry for Processing 2.0. It will be updated shortly.
|
1892
1891
|
*
|
1893
|
-
|
1892
|
+
|
1894
1893
|
*
|
1895
1894
|
* @webref rendering:shaders
|
1896
1895
|
* @param fragFilename name of fragment shader file
|
@@ -1915,7 +1914,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1915
1914
|
*
|
1916
1915
|
* This is a new reference entry for Processing 2.0. It will be updated shortly.
|
1917
1916
|
*
|
1918
|
-
|
1917
|
+
|
1919
1918
|
*
|
1920
1919
|
* @webref rendering:shaders
|
1921
1920
|
* @param shader name of shader file
|
@@ -1938,7 +1937,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1938
1937
|
*
|
1939
1938
|
* This is a new reference entry for Processing 2.0. It will be updated shortly.
|
1940
1939
|
*
|
1941
|
-
|
1940
|
+
|
1942
1941
|
*
|
1943
1942
|
* @webref rendering:shaders
|
1944
1943
|
*/
|
@@ -1975,7 +1974,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
1975
1974
|
* by the parameters. The boundaries are drawn based on the state
|
1976
1975
|
* of the <b>imageMode()</b> fuction, either CORNER, CORNERS, or CENTER.
|
1977
1976
|
*
|
1978
|
-
|
1977
|
+
|
1979
1978
|
*
|
1980
1979
|
* @webref rendering
|
1981
1980
|
* @param a x-coordinate of the rectangle, by default
|
@@ -2026,7 +2025,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2026
2025
|
*
|
2027
2026
|
* Disables the clipping previously started by the <b>clip()</b> function.
|
2028
2027
|
*
|
2029
|
-
|
2028
|
+
|
2030
2029
|
*
|
2031
2030
|
* @webref rendering
|
2032
2031
|
*/
|
@@ -2045,7 +2044,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2045
2044
|
*
|
2046
2045
|
* This is a new reference entry for Processing 2.0. It will be updated shortly.
|
2047
2046
|
*
|
2048
|
-
|
2047
|
+
|
2049
2048
|
*
|
2050
2049
|
* @webref rendering
|
2051
2050
|
* @param mode the blending mode to use
|
@@ -2127,7 +2126,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2127
2126
|
* 3D version requires rendering with P3D (see the Environment reference
|
2128
2127
|
* for more information).
|
2129
2128
|
*
|
2130
|
-
|
2129
|
+
|
2131
2130
|
* @webref shape:vertex
|
2132
2131
|
* @param x2 the x-coordinate of the 1st control point
|
2133
2132
|
* @param y2 the y-coordinate of the 1st control point
|
@@ -2260,7 +2259,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2260
2259
|
* version requires rendering with P3D (see the Environment reference for
|
2261
2260
|
* more information).
|
2262
2261
|
*
|
2263
|
-
|
2262
|
+
|
2264
2263
|
*
|
2265
2264
|
* @webref shape:vertex
|
2266
2265
|
* @param x the x-coordinate of the vertex
|
@@ -2411,7 +2410,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2411
2410
|
* requires the P3D parameter in combination with <b>size()</b> as shown in
|
2412
2411
|
* the above example.
|
2413
2412
|
*
|
2414
|
-
|
2413
|
+
|
2415
2414
|
*
|
2416
2415
|
* @webref shape:2d_primitives
|
2417
2416
|
* @param x x-coordinate of the point
|
@@ -2446,7 +2445,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2446
2445
|
* Drawing this shape in 3D with the <b>z</b> parameter requires the P3D
|
2447
2446
|
* parameter in combination with <b>size()</b> as shown in the above example.
|
2448
2447
|
*
|
2449
|
-
|
2448
|
+
|
2450
2449
|
* @webref shape:2d_primitives
|
2451
2450
|
* @param x1 x-coordinate of the first point
|
2452
2451
|
* @param y1 y-coordinate of the first point
|
@@ -2483,7 +2482,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2483
2482
|
* arguments specify the first point, the middle two arguments specify the
|
2484
2483
|
* second point, and the last two arguments specify the third point.
|
2485
2484
|
*
|
2486
|
-
|
2485
|
+
|
2487
2486
|
* @webref shape:2d_primitives
|
2488
2487
|
* @param x1 x-coordinate of the first point
|
2489
2488
|
* @param y1 y-coordinate of the first point
|
@@ -2512,7 +2511,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2512
2511
|
* vertex and the subsequent pairs should proceed clockwise or
|
2513
2512
|
* counter-clockwise around the defined shape.
|
2514
2513
|
*
|
2515
|
-
|
2514
|
+
|
2516
2515
|
* @webref shape:2d_primitives
|
2517
2516
|
* @param x1 x-coordinate of the first corner
|
2518
2517
|
* @param y1 y-coordinate of the first corner
|
@@ -2558,7 +2557,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2558
2557
|
* sensitive language. Note: In version 125, the mode named CENTER_RADIUS
|
2559
2558
|
* was shortened to RADIUS.
|
2560
2559
|
*
|
2561
|
-
|
2560
|
+
|
2562
2561
|
* @webref shape:attributes
|
2563
2562
|
* @param mode either CORNER, CORNERS, CENTER, or RADIUS
|
2564
2563
|
* @see PGraphics#rect(float, float, float, float)
|
@@ -2577,7 +2576,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2577
2576
|
* fourth sets the height. These parameters may be changed with the
|
2578
2577
|
* <b>rectMode()</b> function.
|
2579
2578
|
*
|
2580
|
-
|
2579
|
+
|
2581
2580
|
*
|
2582
2581
|
* @webref shape:2d_primitives
|
2583
2582
|
* @param a x-coordinate of the rectangle by default
|
@@ -2743,7 +2742,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2743
2742
|
* these parameters are interpreted, however, may be changed with the
|
2744
2743
|
* <b>rectMode()</b> function.
|
2745
2744
|
*
|
2746
|
-
|
2745
|
+
|
2747
2746
|
*
|
2748
2747
|
* @webref shape:2d_primitives
|
2749
2748
|
* @param x x-coordinate of the rectangle by default
|
@@ -2777,7 +2776,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2777
2776
|
* ellipse's bounding box. The parameter must be written in ALL CAPS
|
2778
2777
|
* because Processing is a case-sensitive language.
|
2779
2778
|
*
|
2780
|
-
|
2779
|
+
|
2781
2780
|
* @webref shape:attributes
|
2782
2781
|
* @param mode either CENTER, RADIUS, CORNER, or CORNERS
|
2783
2782
|
* @see PApplet#ellipse(float, float, float, float)
|
@@ -2796,7 +2795,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2796
2795
|
* the location, the third sets the width, and the fourth sets the height.
|
2797
2796
|
* The origin may be changed with the <b>ellipseMode()</b> function.
|
2798
2797
|
*
|
2799
|
-
|
2798
|
+
|
2800
2799
|
* @webref shape:2d_primitives
|
2801
2800
|
* @param a x-coordinate of the ellipse
|
2802
2801
|
* @param b y-coordinate of the ellipse
|
@@ -2853,7 +2852,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2853
2852
|
* with the <b>ellipseMode()</b> function. The <b>start</b> and <b>stop</b>
|
2854
2853
|
* parameters specify the angles at which to draw the arc.
|
2855
2854
|
*
|
2856
|
-
|
2855
|
+
|
2857
2856
|
* @webref shape:2d_primitives
|
2858
2857
|
* @param a x-coordinate of the arc's ellipse
|
2859
2858
|
* @param b y-coordinate of the arc's ellipse
|
@@ -2940,7 +2939,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2940
2939
|
* and height. The origin may be changed with the <b>ellipseMode()</b>
|
2941
2940
|
* function.
|
2942
2941
|
*
|
2943
|
-
|
2942
|
+
|
2944
2943
|
* @webref shape:2d_primitives
|
2945
2944
|
* @param x x-coordinate of the ellipse
|
2946
2945
|
* @param y y-coordinate of the ellipse
|
@@ -2963,7 +2962,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
2963
2962
|
* A box is an extruded rectangle. A box with equal dimension on all sides
|
2964
2963
|
* is a cube.
|
2965
2964
|
*
|
2966
|
-
|
2965
|
+
|
2967
2966
|
*
|
2968
2967
|
* @webref shape:3d_primitives
|
2969
2968
|
* @param size dimension of the box in all dimensions (creates a cube)
|
@@ -3056,7 +3055,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3056
3055
|
* and vertical resolution independently, use the version of the functions
|
3057
3056
|
* with two parameters.
|
3058
3057
|
*
|
3059
|
-
|
3058
|
+
|
3060
3059
|
*
|
3061
3060
|
* <h3>Advanced</h3>
|
3062
3061
|
* Code for sphereDetail() submitted by toxi [031031].
|
@@ -3080,7 +3079,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3080
3079
|
if (vres < 2) vres = 2; // force a minimum res
|
3081
3080
|
if ((ures == sphereDetailU) && (vres == sphereDetailV)) return;
|
3082
3081
|
|
3083
|
-
float delta = (
|
3082
|
+
float delta = 360 / (ures * SINCOS_PRECISION);
|
3084
3083
|
float[] cx = new float[ures];
|
3085
3084
|
float[] cz = new float[ures];
|
3086
3085
|
// calc unit circle in XZ plane
|
@@ -3098,7 +3097,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3098
3097
|
sphereY = new float[vertCount];
|
3099
3098
|
sphereZ = new float[vertCount];
|
3100
3099
|
|
3101
|
-
float angle_step = (
|
3100
|
+
float angle_step = (SINCOS_PRECISION*0.5f)/vres;
|
3102
3101
|
float angle = angle_step;
|
3103
3102
|
|
3104
3103
|
// step along Y axis
|
@@ -3122,7 +3121,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3122
3121
|
*
|
3123
3122
|
* A sphere is a hollow ball made from tessellated triangles.
|
3124
3123
|
*
|
3125
|
-
|
3124
|
+
|
3126
3125
|
*
|
3127
3126
|
* <h3>Advanced</h3>
|
3128
3127
|
* <P>
|
@@ -3162,8 +3161,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
3162
3161
|
for (int i = 0; i < sphereDetailU; i++) {
|
3163
3162
|
normal(0, -1, 0);
|
3164
3163
|
vertex(0, -r, 0);
|
3165
|
-
normal(sphereX[i], sphereY[i], sphereZ[i]);
|
3166
|
-
vertex(r * sphereX[i], r * sphereY[i], r * sphereZ[i]);
|
3164
|
+
normal((float)sphereX[i], (float)sphereY[i], (float)sphereZ[i]);
|
3165
|
+
vertex(r * (float)sphereX[i], r * (float)sphereY[i], r * (float)sphereZ[i]);
|
3167
3166
|
}
|
3168
3167
|
normal(0, -r, 0);
|
3169
3168
|
vertex(0, -r, 0);
|
@@ -3229,7 +3228,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3229
3228
|
* second time with the y coordinates to get the location of a bezier curve
|
3230
3229
|
* at t.
|
3231
3230
|
*
|
3232
|
-
|
3231
|
+
|
3233
3232
|
*
|
3234
3233
|
* <h3>Advanced</h3>
|
3235
3234
|
* For instance, to convert the following example:<PRE>
|
@@ -3273,7 +3272,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3273
3272
|
* definition of <a href="http://en.wikipedia.org/wiki/Tangent"
|
3274
3273
|
* target="new"><em>tangent</em> on Wikipedia</a>.
|
3275
3274
|
*
|
3276
|
-
|
3275
|
+
|
3277
3276
|
*
|
3278
3277
|
* <h3>Advanced</h3>
|
3279
3278
|
* Code submitted by Dave Bollinger (davol) for release 0136.
|
@@ -3316,7 +3315,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3316
3315
|
* This function is only useful when using the P3D renderer as the default
|
3317
3316
|
* P2D renderer does not use this information.
|
3318
3317
|
*
|
3319
|
-
|
3318
|
+
|
3320
3319
|
*
|
3321
3320
|
* @webref shape:curves
|
3322
3321
|
* @param detail resolution of the curves
|
@@ -3364,7 +3363,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3364
3363
|
* Bezier. Using the 3D version requires rendering with P3D (see the
|
3365
3364
|
* Environment reference for more information).
|
3366
3365
|
*
|
3367
|
-
|
3366
|
+
|
3368
3367
|
*
|
3369
3368
|
* <h3>Advanced</h3>
|
3370
3369
|
* Draw a cubic bezier curve. The first and last points are
|
@@ -3432,7 +3431,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3432
3431
|
* the points on the curve. This can be done once with the x coordinates and a
|
3433
3432
|
* second time with the y coordinates to get the location of a curve at t.
|
3434
3433
|
*
|
3435
|
-
|
3434
|
+
|
3436
3435
|
*
|
3437
3436
|
* @webref shape:curves
|
3438
3437
|
* @param a coordinate of first control point
|
@@ -3466,7 +3465,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3466
3465
|
* of <em><a href="http://en.wikipedia.org/wiki/Tangent"
|
3467
3466
|
* target="new">tangent on Wikipedia</a></em>.
|
3468
3467
|
*
|
3469
|
-
|
3468
|
+
|
3470
3469
|
*
|
3471
3470
|
* <h3>Advanced</h3>
|
3472
3471
|
* Code thanks to Dave Bollinger (Bug #715)
|
@@ -3504,7 +3503,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3504
3503
|
* This function is only useful when using the P3D renderer as the default
|
3505
3504
|
* P2D renderer does not use this information.
|
3506
3505
|
*
|
3507
|
-
|
3506
|
+
|
3508
3507
|
*
|
3509
3508
|
* @webref shape:curves
|
3510
3509
|
* @param detail resolution of the curves
|
@@ -3529,7 +3528,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3529
3528
|
* within the range -5.0 and 5.0 will deform the curves but will leave them
|
3530
3529
|
* recognizable and as values increase in magnitude, they will continue to deform.
|
3531
3530
|
*
|
3532
|
-
|
3531
|
+
|
3533
3532
|
*
|
3534
3533
|
* @webref shape:curves
|
3535
3534
|
* @param tightness amount of deformation from the original vertices
|
@@ -3608,10 +3607,10 @@ public class PGraphics extends PImage implements PConstants {
|
|
3608
3607
|
* implementation of Catmull-Rom splines. Using the 3D version requires
|
3609
3608
|
* rendering with P3D (see the Environment reference for more information).
|
3610
3609
|
*
|
3611
|
-
|
3610
|
+
|
3612
3611
|
*
|
3613
3612
|
* <h3>Advanced</h3>
|
3614
|
-
* As of revision 0070, this function no longer
|
3613
|
+
* As of revision 0070, this function no longer floats the first
|
3615
3614
|
* and last points. The curves are a bit more boring, but it's more
|
3616
3615
|
* mathematically correct, and properly mirrored in curvePoint().
|
3617
3616
|
* <P>
|
@@ -3751,11 +3750,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
3751
3750
|
* the fourth and fifth parameters to set the opposite corner. Use
|
3752
3751
|
* <b>imageMode(CENTER)</b> to draw images centered at the given x and y
|
3753
3752
|
* position.
|
3754
|
-
*
|
3753
|
+
*
|
3755
3754
|
* The parameter to <b>imageMode()</b> must be written in ALL CAPS because
|
3756
3755
|
* Processing is a case-sensitive language.
|
3757
3756
|
*
|
3758
|
-
|
3757
|
+
|
3759
3758
|
*
|
3760
3759
|
* @webref image:loading_displaying
|
3761
3760
|
* @param mode either CORNER, CORNERS, or CENTER
|
@@ -3786,16 +3785,16 @@ public class PGraphics extends PImage implements PConstants {
|
|
3786
3785
|
* its upper-left corner. The image is displayed at its original size
|
3787
3786
|
* unless the <b>width</b> and <b>height</b> parameters specify a different
|
3788
3787
|
* size.
|
3789
|
-
*
|
3788
|
+
*
|
3790
3789
|
* The <b>imageMode()</b> function changes the way the parameters work. For
|
3791
3790
|
* example, a call to <b>imageMode(CORNERS)</b> will change the
|
3792
3791
|
* <b>width</b> and <b>height</b> parameters to define the x and y values
|
3793
3792
|
* of the opposite corner of the image.
|
3794
|
-
*
|
3793
|
+
*
|
3795
3794
|
* The color of an image may be modified with the <b>tint()</b> function.
|
3796
3795
|
* This function will maintain transparency for GIF and PNG images.
|
3797
3796
|
*
|
3798
|
-
|
3797
|
+
|
3799
3798
|
*
|
3800
3799
|
* <h3>Advanced</h3>
|
3801
3800
|
* Starting with release 0124, when using the default (JAVA2D) renderer,
|
@@ -3895,7 +3894,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3895
3894
|
/**
|
3896
3895
|
* Expects x1, y1, x2, y2 coordinates where (x2 >= x1) and (y2 >= y1).
|
3897
3896
|
* If tint() has been called, the image will be colored.
|
3898
|
-
*
|
3897
|
+
*
|
3899
3898
|
* The default implementation draws an image as a textured quad.
|
3900
3899
|
* The (u, v) coordinates are in image space (they're ints, after all..)
|
3901
3900
|
*/
|
@@ -3973,7 +3972,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
3973
3972
|
* and height. The parameter must be written in "ALL CAPS" because
|
3974
3973
|
* Processing is a case sensitive language.
|
3975
3974
|
*
|
3976
|
-
|
3975
|
+
|
3977
3976
|
*
|
3978
3977
|
* @webref shape:loading_displaying
|
3979
3978
|
* @param mode either CORNER, CORNERS, CENTER
|
@@ -4020,11 +4019,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
4020
4019
|
* to <b>shapeMode(CORNERS)</b>, for example, will change the width and
|
4021
4020
|
* height parameters to define the x and y values of the opposite corner of
|
4022
4021
|
* the shape.
|
4023
|
-
*
|
4022
|
+
*
|
4024
4023
|
* Note complex shapes may draw awkwardly with P3D. This renderer does not
|
4025
4024
|
* yet support shapes that have holes or complicated breaks.
|
4026
4025
|
*
|
4027
|
-
|
4026
|
+
|
4028
4027
|
*
|
4029
4028
|
* @webref shape:loading_displaying
|
4030
4029
|
* @param shape the shape to display
|
@@ -4169,7 +4168,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4169
4168
|
* CENTER, and RIGHT set the display characteristics of the letters in
|
4170
4169
|
* relation to the values for the <b>x</b> and <b>y</b> parameters of the
|
4171
4170
|
* <b>text()</b> function.
|
4172
|
-
*
|
4171
|
+
*
|
4173
4172
|
* In Processing 0125 and later, an optional second parameter can be used
|
4174
4173
|
* to vertically align the text. BASELINE is the default, and the vertical
|
4175
4174
|
* alignment will be reset to BASELINE if the second parameter is not used.
|
@@ -4177,12 +4176,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
4177
4176
|
* offsets the line based on the current <b>textDescent()</b>. For multiple
|
4178
4177
|
* lines, the final line will be aligned to the bottom, with the previous
|
4179
4178
|
* lines appearing above it.
|
4180
|
-
*
|
4179
|
+
*
|
4181
4180
|
* When using <b>text()</b> with width and height parameters, BASELINE is
|
4182
4181
|
* ignored, and treated as TOP. (Otherwise, text would by default draw
|
4183
4182
|
* outside the box, since BASELINE is the default setting. BASELINE is not
|
4184
4183
|
* a useful drawing mode for text drawn in a rectangle.)
|
4185
|
-
*
|
4184
|
+
*
|
4186
4185
|
* The vertical alignment is based on the value of <b>textAscent()</b>,
|
4187
4186
|
* which many fonts do not specify correctly. It may be necessary to use a
|
4188
4187
|
* hack and offset by a few pixels by hand so that the offset looks
|
@@ -4190,7 +4189,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4190
4189
|
* <b>textAscent()</b> or <b>textDescent()</b> so that the hack works even
|
4191
4190
|
* if you change the size of the font.
|
4192
4191
|
*
|
4193
|
-
|
4192
|
+
|
4194
4193
|
*
|
4195
4194
|
* @webref typography:attributes
|
4196
4195
|
* @param alignX horizontal alignment, either LEFT, CENTER, or RIGHT
|
@@ -4216,7 +4215,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4216
4215
|
* example, adding the <b>textAscent()</b> and <b>textDescent()</b> values
|
4217
4216
|
* will give you the total height of the line.
|
4218
4217
|
*
|
4219
|
-
|
4218
|
+
|
4220
4219
|
*
|
4221
4220
|
* @webref typography:metrics
|
4222
4221
|
* @see PGraphics#textDescent()
|
@@ -4237,7 +4236,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4237
4236
|
* baseline. For example, adding the <b>textAscent()</b> and
|
4238
4237
|
* <b>textDescent()</b> values will give you the total height of the line.
|
4239
4238
|
*
|
4240
|
-
|
4239
|
+
|
4241
4240
|
*
|
4242
4241
|
* @webref typography:metrics
|
4243
4242
|
* @see PGraphics#textAscent()
|
@@ -4269,7 +4268,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4269
4268
|
* available: when the font is still installed, or the font is created via
|
4270
4269
|
* the <b>createFont()</b> function (rather than the Create Font tool).
|
4271
4270
|
*
|
4272
|
-
|
4271
|
+
|
4273
4272
|
*
|
4274
4273
|
* @webref typography:loading_displaying
|
4275
4274
|
* @param which any variable of the type PFont
|
@@ -4356,7 +4355,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4356
4355
|
* Sets the spacing between lines of text in units of pixels. This setting
|
4357
4356
|
* will be used in all subsequent calls to the <b>text()</b> function.
|
4358
4357
|
*
|
4359
|
-
|
4358
|
+
|
4360
4359
|
*
|
4361
4360
|
* @webref typography:attributes
|
4362
4361
|
* @param leading the size in pixels for spacing between lines
|
@@ -4377,7 +4376,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4377
4376
|
* Sets the way text draws to the screen. In the default configuration, the
|
4378
4377
|
* <b>MODEL</b> mode, it's possible to rotate, scale, and place letters in
|
4379
4378
|
* two and three dimensional space.
|
4380
|
-
*
|
4379
|
+
*
|
4381
4380
|
* The <b>SHAPE</b> mode draws text using the the glyph outlines of
|
4382
4381
|
* individual characters rather than as textures. This mode is only
|
4383
4382
|
* supported with the <b>PDF</b> and <b>P3D</b> renderer settings. With the
|
@@ -4385,14 +4384,14 @@ public class PGraphics extends PImage implements PConstants {
|
|
4385
4384
|
* other drawing occurs. If the outlines are not available, then
|
4386
4385
|
* <b>textMode(SHAPE)</b> will be ignored and <b>textMode(MODEL)</b> will
|
4387
4386
|
* be used instead.
|
4388
|
-
*
|
4387
|
+
*
|
4389
4388
|
* The <b>textMode(SHAPE)</b> option in <b>P3D</b> can be combined with
|
4390
4389
|
* <b>beginRaw()</b> to write vector-accurate text to 2D and 3D output
|
4391
4390
|
* files, for instance <b>DXF</b> or <b>PDF</b>. The <b>SHAPE</b> mode is
|
4392
4391
|
* not currently optimized for <b>P3D</b>, so if recording shape data, use
|
4393
4392
|
* <b>textMode(MODEL)</b> until you're ready to capture the geometry with <b>beginRaw()</b>.
|
4394
4393
|
*
|
4395
|
-
|
4394
|
+
|
4396
4395
|
*
|
4397
4396
|
* @webref typography:attributes
|
4398
4397
|
* @param mode either MODEL or SHAPE
|
@@ -4438,7 +4437,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4438
4437
|
* Sets the current font size. This size will be used in all subsequent
|
4439
4438
|
* calls to the <b>text()</b> function. Font size is measured in units of pixels.
|
4440
4439
|
*
|
4441
|
-
|
4440
|
+
|
4442
4441
|
*
|
4443
4442
|
* @webref typography:attributes
|
4444
4443
|
* @param size the size of the letters in units of pixels
|
@@ -4502,7 +4501,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
4502
4501
|
*
|
4503
4502
|
* Calculates and returns the width of any character or text string.
|
4504
4503
|
*
|
4505
|
-
|
4504
|
+
|
4506
4505
|
*
|
4507
4506
|
* @webref typography:attributes
|
4508
4507
|
* @param str the String of characters to measure
|
@@ -4579,13 +4578,13 @@ public class PGraphics extends PImage implements PConstants {
|
|
4579
4578
|
* with the <b>fill()</b> function. The text displays in relation to the
|
4580
4579
|
* <b>textAlign()</b> function, which gives the option to draw to the left,
|
4581
4580
|
* right, and center of the coordinates.
|
4582
|
-
*
|
4581
|
+
*
|
4583
4582
|
* The <b>x2</b> and <b>y2</b> parameters define a rectangular area to
|
4584
4583
|
* display within and may only be used with string data. For text drawn
|
4585
4584
|
* inside a rectangle, the coordinates are interpreted based on the current
|
4586
4585
|
* <b>rectMode()</b> setting.
|
4587
4586
|
*
|
4588
|
-
|
4587
|
+
|
4589
4588
|
*
|
4590
4589
|
* @webref typography:loading_displaying
|
4591
4590
|
* @param c the alphanumeric character to be displayed
|
@@ -4749,11 +4748,11 @@ public class PGraphics extends PImage implements PConstants {
|
|
4749
4748
|
* Draw text in a box that is constrained to a particular size.
|
4750
4749
|
* The current rectMode() determines what the coordinates mean
|
4751
4750
|
* (whether x1/y1/x2/y2 or x/y/w/h).
|
4752
|
-
*
|
4751
|
+
*
|
4753
4752
|
* Note that the x,y coords of the start of the box
|
4754
4753
|
* will align with the *ascent* of the text, not the baseline,
|
4755
4754
|
* as is the case for the other text() functions.
|
4756
|
-
*
|
4755
|
+
*
|
4757
4756
|
* Newlines that are \n (Unix newline or linefeed char, ascii 10)
|
4758
4757
|
* are honored, and \r (carriage return, Windows and Mac OS) are
|
4759
4758
|
* ignored.
|
@@ -5178,7 +5177,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5178
5177
|
* and later return to what you had. When a new state is started
|
5179
5178
|
* with push(), it builds on the current style and transform
|
5180
5179
|
* information.
|
5181
|
-
*
|
5180
|
+
*
|
5182
5181
|
* <b>push()</b> stores information related to the current
|
5183
5182
|
* transformation state and style settings controlled by the
|
5184
5183
|
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
@@ -5187,7 +5186,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5187
5186
|
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5188
5187
|
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5189
5188
|
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.
|
5190
|
-
*
|
5189
|
+
*
|
5191
5190
|
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5192
5191
|
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5193
5192
|
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
@@ -5195,7 +5194,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5195
5194
|
* transformations (rotate, scale, translate) and the drawing styles
|
5196
5195
|
* at the same time.
|
5197
5196
|
*
|
5198
|
-
|
5197
|
+
|
5199
5198
|
*
|
5200
5199
|
* @webref structure
|
5201
5200
|
* @see PGraphics#pop()
|
@@ -5214,8 +5213,8 @@ public class PGraphics extends PImage implements PConstants {
|
|
5214
5213
|
* you to change the style and transformation settings and later
|
5215
5214
|
* return to what you had. When a new state is started with push(),
|
5216
5215
|
* it builds on the current style and transform information.
|
5217
|
-
*
|
5218
|
-
*
|
5216
|
+
*
|
5217
|
+
*
|
5219
5218
|
* <b>push()</b> stores information related to the current
|
5220
5219
|
* transformation state and style settings controlled by the
|
5221
5220
|
* following functions: <b>rotate()</b>, <b>translate()</b>,
|
@@ -5224,7 +5223,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5224
5223
|
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
|
5225
5224
|
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
|
5226
5225
|
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.
|
5227
|
-
*
|
5226
|
+
*
|
5228
5227
|
* The <b>push()</b> and <b>pop()</b> functions were added with
|
5229
5228
|
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
|
5230
5229
|
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
|
@@ -5232,7 +5231,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5232
5231
|
* transformations (rotate, scale, translate) and the drawing styles
|
5233
5232
|
* at the same time.
|
5234
5233
|
*
|
5235
|
-
|
5234
|
+
|
5236
5235
|
*
|
5237
5236
|
* @webref structure
|
5238
5237
|
* @see PGraphics#push()
|
@@ -5261,7 +5260,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5261
5260
|
* the other transformation functions and may be embedded to control the
|
5262
5261
|
* scope of the transformations.
|
5263
5262
|
*
|
5264
|
-
|
5263
|
+
|
5265
5264
|
*
|
5266
5265
|
* @webref transform
|
5267
5266
|
* @see PGraphics#popMatrix()
|
@@ -5288,7 +5287,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5288
5287
|
* in conjuction with the other transformation functions and may be
|
5289
5288
|
* embedded to control the scope of the transformations.
|
5290
5289
|
*
|
5291
|
-
|
5290
|
+
|
5292
5291
|
*
|
5293
5292
|
* @webref transform
|
5294
5293
|
* @see PGraphics#pushMatrix()
|
@@ -5320,7 +5319,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5320
5319
|
* transformation is reset when the loop begins again. This function can be
|
5321
5320
|
* further controlled by the <b>pushMatrix()</b> and <b>popMatrix()</b>.
|
5322
5321
|
*
|
5323
|
-
|
5322
|
+
|
5324
5323
|
*
|
5325
5324
|
* @webref transform
|
5326
5325
|
* @param x left/right translation
|
@@ -5352,7 +5351,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5352
5351
|
* Rotates a shape the amount specified by the <b>angle</b> parameter.
|
5353
5352
|
* Angles should be specified in radians (values from 0 to TWO_PI) or
|
5354
5353
|
* converted to radians with the <b>radians()</b> function.
|
5355
|
-
*
|
5354
|
+
*
|
5356
5355
|
* Objects are always rotated around their relative position to the origin
|
5357
5356
|
* and positive numbers rotate objects in a clockwise direction.
|
5358
5357
|
* Transformations apply to everything that happens after and subsequent
|
@@ -5360,12 +5359,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
5360
5359
|
* <b>rotate(HALF_PI)</b> and then <b>rotate(HALF_PI)</b> is the same as
|
5361
5360
|
* <b>rotate(PI)</b>. All tranformations are reset when <b>draw()</b>
|
5362
5361
|
* begins again.
|
5363
|
-
*
|
5362
|
+
*
|
5364
5363
|
* Technically, <b>rotate()</b> multiplies the current transformation
|
5365
5364
|
* matrix by a rotation matrix. This function can be further controlled by
|
5366
5365
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b>.
|
5367
5366
|
*
|
5368
|
-
|
5367
|
+
|
5369
5368
|
*
|
5370
5369
|
* @webref transform
|
5371
5370
|
* @param angle angle of rotation specified in radians
|
@@ -5398,7 +5397,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5398
5397
|
* This function requires using P3D as a third parameter to <b>size()</b>
|
5399
5398
|
* as shown in the example above.
|
5400
5399
|
*
|
5401
|
-
|
5400
|
+
|
5402
5401
|
*
|
5403
5402
|
* @webref transform
|
5404
5403
|
* @param angle angle of rotation specified in radians
|
@@ -5431,7 +5430,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5431
5430
|
* This function requires using P3D as a third parameter to <b>size()</b>
|
5432
5431
|
* as shown in the examples above.
|
5433
5432
|
*
|
5434
|
-
|
5433
|
+
|
5435
5434
|
*
|
5436
5435
|
* @webref transform
|
5437
5436
|
* @param angle angle of rotation specified in radians
|
@@ -5464,7 +5463,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5464
5463
|
* This function requires using P3D as a third parameter to <b>size()</b>
|
5465
5464
|
* as shown in the examples above.
|
5466
5465
|
*
|
5467
|
-
|
5466
|
+
|
5468
5467
|
*
|
5469
5468
|
* @webref transform
|
5470
5469
|
* @param angle angle of rotation specified in radians
|
@@ -5510,7 +5509,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5510
5509
|
* parameter for <b>size()</b> as shown in the example above. This function
|
5511
5510
|
* can be further controlled by <b>pushMatrix()</b> and <b>popMatrix()</b>.
|
5512
5511
|
*
|
5513
|
-
|
5512
|
+
|
5514
5513
|
*
|
5515
5514
|
* @webref transform
|
5516
5515
|
* @param s percentage to scale the object
|
@@ -5563,12 +5562,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
5563
5562
|
* <b>shearX(PI/2)</b> and then <b>shearX(PI/2)</b> is the same as
|
5564
5563
|
* <b>shearX(PI)</b>. If <b>shearX()</b> is called within the
|
5565
5564
|
* <b>draw()</b>, the transformation is reset when the loop begins again.
|
5566
|
-
*
|
5565
|
+
*
|
5567
5566
|
* Technically, <b>shearX()</b> multiplies the current transformation
|
5568
5567
|
* matrix by a rotation matrix. This function can be further controlled by
|
5569
5568
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b> functions.
|
5570
5569
|
*
|
5571
|
-
|
5570
|
+
|
5572
5571
|
*
|
5573
5572
|
* @webref transform
|
5574
5573
|
* @param angle angle of shear specified in radians
|
@@ -5597,12 +5596,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
5597
5596
|
* <b>shearY(PI/2)</b> and then <b>shearY(PI/2)</b> is the same as
|
5598
5597
|
* <b>shearY(PI)</b>. If <b>shearY()</b> is called within the
|
5599
5598
|
* <b>draw()</b>, the transformation is reset when the loop begins again.
|
5600
|
-
*
|
5599
|
+
*
|
5601
5600
|
* Technically, <b>shearY()</b> multiplies the current transformation
|
5602
5601
|
* matrix by a rotation matrix. This function can be further controlled by
|
5603
5602
|
* the <b>pushMatrix()</b> and <b>popMatrix()</b> functions.
|
5604
5603
|
*
|
5605
|
-
|
5604
|
+
|
5606
5605
|
*
|
5607
5606
|
* @webref transform
|
5608
5607
|
* @param angle angle of shear specified in radians
|
@@ -5629,7 +5628,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5629
5628
|
* Replaces the current matrix with the identity matrix. The equivalent
|
5630
5629
|
* function in OpenGL is glLoadIdentity().
|
5631
5630
|
*
|
5632
|
-
|
5631
|
+
|
5633
5632
|
*
|
5634
5633
|
* @webref transform
|
5635
5634
|
* @see PGraphics#pushMatrix()
|
@@ -5649,7 +5648,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5649
5648
|
* inverse of the transform, so avoid it whenever possible. The equivalent
|
5650
5649
|
* function in OpenGL is glMultMatrix().
|
5651
5650
|
*
|
5652
|
-
|
5651
|
+
|
5653
5652
|
*
|
5654
5653
|
* @webref transform
|
5655
5654
|
* @source
|
@@ -5780,7 +5779,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5780
5779
|
* Prints the current matrix to the Console (the text window at the bottom
|
5781
5780
|
* of Processing).
|
5782
5781
|
*
|
5783
|
-
|
5782
|
+
|
5784
5783
|
*
|
5785
5784
|
* @webref transform
|
5786
5785
|
* @see PGraphics#pushMatrix()
|
@@ -5817,7 +5816,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5817
5816
|
* following <b>endCamera()</b> and pairs of <b>beginCamera()</b> and
|
5818
5817
|
* <b>endCamera()</b> cannot be nested.
|
5819
5818
|
*
|
5820
|
-
|
5819
|
+
|
5821
5820
|
*
|
5822
5821
|
* @webref lights_camera:camera
|
5823
5822
|
* @see PGraphics#camera()
|
@@ -5838,7 +5837,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5838
5837
|
* advanced customization of the camera space. Please see the reference for
|
5839
5838
|
* <b>beginCamera()</b> for a description of how the functions are used.
|
5840
5839
|
*
|
5841
|
-
|
5840
|
+
|
5842
5841
|
*
|
5843
5842
|
* @webref lights_camera:camera
|
5844
5843
|
* @see PGraphics#beginCamera()
|
@@ -5861,7 +5860,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5861
5860
|
* 180.0), width/2.0, height/2.0, 0, 0, 1, 0)</b>. This function is similar
|
5862
5861
|
* to <b>gluLookAt()</b> in OpenGL, but it first clears the current camera settings.
|
5863
5862
|
*
|
5864
|
-
|
5863
|
+
|
5865
5864
|
*
|
5866
5865
|
* @webref lights_camera:camera
|
5867
5866
|
* @see PGraphics#beginCamera()
|
@@ -5895,7 +5894,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5895
5894
|
* Prints the current camera matrix to the Console (the text window at the
|
5896
5895
|
* bottom of Processing).
|
5897
5896
|
*
|
5898
|
-
|
5897
|
+
|
5899
5898
|
* @webref lights_camera:camera
|
5900
5899
|
* @see PGraphics#camera(float, float, float, float, float, float, float, float, float)
|
5901
5900
|
*/
|
@@ -5921,7 +5920,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5921
5920
|
* parameters are given, the default is used: ortho(0, width, 0, height,
|
5922
5921
|
* -10, 10).
|
5923
5922
|
*
|
5924
|
-
|
5923
|
+
|
5925
5924
|
*
|
5926
5925
|
* @webref lights_camera:camera
|
5927
5926
|
*/
|
@@ -5964,7 +5963,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5964
5963
|
* default values are: perspective(PI/3.0, width/height, cameraZ/10.0,
|
5965
5964
|
* cameraZ*10.0) where cameraZ is ((height/2.0) / tan(PI*60.0/360.0));
|
5966
5965
|
*
|
5967
|
-
|
5966
|
+
|
5968
5967
|
*
|
5969
5968
|
* @webref lights_camera:camera
|
5970
5969
|
*/
|
@@ -5989,7 +5988,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
5989
5988
|
* glFrustum, except it wipes out the current perspective matrix rather
|
5990
5989
|
* than muliplying itself with it.
|
5991
5990
|
*
|
5992
|
-
|
5991
|
+
|
5993
5992
|
*
|
5994
5993
|
* @webref lights_camera:camera
|
5995
5994
|
* @param left left coordinate of the clipping plane
|
@@ -6015,7 +6014,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6015
6014
|
* Prints the current projection matrix to the Console (the text window at
|
6016
6015
|
* the bottom of Processing).
|
6017
6016
|
*
|
6018
|
-
|
6017
|
+
|
6019
6018
|
*
|
6020
6019
|
* @webref lights_camera:camera
|
6021
6020
|
* @see PGraphics#camera(float, float, float, float, float, float, float, float, float)
|
@@ -6037,7 +6036,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6037
6036
|
* Takes a three-dimensional X, Y, Z position and returns the X value for
|
6038
6037
|
* where it will appear on a (two-dimensional) screen.
|
6039
6038
|
*
|
6040
|
-
|
6039
|
+
|
6041
6040
|
*
|
6042
6041
|
* @webref lights_camera:coordinates
|
6043
6042
|
* @param x 3D x-coordinate to be mapped
|
@@ -6057,7 +6056,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6057
6056
|
* Takes a three-dimensional X, Y, Z position and returns the Y value for
|
6058
6057
|
* where it will appear on a (two-dimensional) screen.
|
6059
6058
|
*
|
6060
|
-
|
6059
|
+
|
6061
6060
|
*
|
6062
6061
|
* @webref lights_camera:coordinates
|
6063
6062
|
* @param x 3D x-coordinate to be mapped
|
@@ -6073,7 +6072,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6073
6072
|
|
6074
6073
|
/**
|
6075
6074
|
* @param z 3D z-coordinate to be mapped
|
6076
|
-
* @return
|
6075
|
+
* @return
|
6077
6076
|
*/
|
6078
6077
|
public float screenX(float x, float y, float z) {
|
6079
6078
|
showMissingWarning("screenX");
|
@@ -6098,7 +6097,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6098
6097
|
* where it will appear on a (two-dimensional) screen.( end auto-generated )
|
6099
6098
|
*
|
6100
6099
|
*
|
6101
|
-
* @return
|
6100
|
+
* @return
|
6102
6101
|
* @webref lights_camera:coordinates
|
6103
6102
|
* @param x 3D x-coordinate to be mapped
|
6104
6103
|
* @param y 3D y-coordinate to be mapped
|
@@ -6126,9 +6125,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
6126
6125
|
* (x, y, z) coordinate returned by the model functions is used to place
|
6127
6126
|
* another box in the same location.
|
6128
6127
|
*
|
6129
|
-
|
6128
|
+
|
6130
6129
|
*
|
6131
|
-
* @return
|
6130
|
+
* @return
|
6132
6131
|
* @webref lights_camera:coordinates
|
6133
6132
|
* @param x 3D x-coordinate to be mapped
|
6134
6133
|
* @param y 3D y-coordinate to be mapped
|
@@ -6156,9 +6155,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
6156
6155
|
* (x, y, z) coordinate returned by the model functions is used to place
|
6157
6156
|
* another box in the same location.
|
6158
6157
|
*
|
6159
|
-
|
6158
|
+
|
6160
6159
|
*
|
6161
|
-
* @return
|
6160
|
+
* @return
|
6162
6161
|
* @webref lights_camera:coordinates
|
6163
6162
|
* @param x 3D x-coordinate to be mapped
|
6164
6163
|
* @param y 3D y-coordinate to be mapped
|
@@ -6186,9 +6185,9 @@ public class PGraphics extends PImage implements PConstants {
|
|
6186
6185
|
* (x, y, z) coordinate returned by the model functions is used to place
|
6187
6186
|
* another box in the same location.
|
6188
6187
|
*
|
6189
|
-
|
6188
|
+
|
6190
6189
|
*
|
6191
|
-
* @return
|
6190
|
+
* @return
|
6192
6191
|
* @webref lights_camera:coordinates
|
6193
6192
|
* @param x 3D x-coordinate to be mapped
|
6194
6193
|
* @param y 3D y-coordinate to be mapped
|
@@ -6217,7 +6216,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6217
6216
|
* <b>pushStyle()</b>, it builds on the current style information. The
|
6218
6217
|
* <b>pushStyle()</b> and <b>popStyle()</b> functions can be embedded to
|
6219
6218
|
* provide more control (see the second example above for a demonstration.)
|
6220
|
-
*
|
6219
|
+
*
|
6221
6220
|
* The style information controlled by the following functions are included
|
6222
6221
|
* in the style:
|
6223
6222
|
* fill(), stroke(), tint(), strokeWeight(), strokeCap(), strokeJoin(),
|
@@ -6225,7 +6224,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6225
6224
|
* textAlign(), textFont(), textMode(), textSize(), textLeading(),
|
6226
6225
|
* emissive(), specular(), shininess(), ambient()
|
6227
6226
|
*
|
6228
|
-
|
6227
|
+
|
6229
6228
|
*
|
6230
6229
|
* @webref structure
|
6231
6230
|
* @see PGraphics#popStyle()
|
@@ -6252,7 +6251,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6252
6251
|
* <b>pushStyle()</b> and <b>popStyle()</b> functions can be embedded to
|
6253
6252
|
* provide more control (see the second example above for a demonstration.)
|
6254
6253
|
*
|
6255
|
-
|
6254
|
+
|
6256
6255
|
*
|
6257
6256
|
* @webref structure
|
6258
6257
|
* @see PGraphics#pushStyle()
|
@@ -6410,7 +6409,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6410
6409
|
*
|
6411
6410
|
* Sets the width of the stroke used for lines, points, and the border
|
6412
6411
|
* around shapes. All widths are set in units of pixels.
|
6413
|
-
*
|
6412
|
+
*
|
6414
6413
|
* When drawing with P3D, series of connected lines (such as the stroke
|
6415
6414
|
* around a polygon, triangle, or ellipse) produce unattractive results
|
6416
6415
|
* when a thick stroke weight is set (<a
|
@@ -6420,7 +6419,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6420
6419
|
* operating system's OpenGL implementation. For instance, the thickness
|
6421
6420
|
* may not go higher than 10 pixels.
|
6422
6421
|
*
|
6423
|
-
|
6422
|
+
|
6424
6423
|
*
|
6425
6424
|
* @webref shape:attributes
|
6426
6425
|
* @param weight the weight (in pixels) of the stroke
|
@@ -6439,13 +6438,13 @@ public class PGraphics extends PImage implements PConstants {
|
|
6439
6438
|
* are either mitered, beveled, or rounded and specified with the
|
6440
6439
|
* corresponding parameters MITER, BEVEL, and ROUND. The default joint is
|
6441
6440
|
* MITER.
|
6442
|
-
*
|
6441
|
+
*
|
6443
6442
|
* This function is not available with the P3D renderer, (<a
|
6444
6443
|
* href="http://code.google.com/p/processing/issues/detail?id=123">see
|
6445
6444
|
* Issue 123</a>). More information about the renderers can be found in the
|
6446
6445
|
* <b>size()</b> reference.
|
6447
6446
|
*
|
6448
|
-
|
6447
|
+
|
6449
6448
|
*
|
6450
6449
|
* @webref shape:attributes
|
6451
6450
|
* @param join either MITER, BEVEL, ROUND
|
@@ -6463,13 +6462,13 @@ public class PGraphics extends PImage implements PConstants {
|
|
6463
6462
|
* Sets the style for rendering line endings. These ends are either
|
6464
6463
|
* squared, extended, or rounded and specified with the corresponding
|
6465
6464
|
* parameters SQUARE, PROJECT, and ROUND. The default cap is ROUND.
|
6466
|
-
*
|
6465
|
+
*
|
6467
6466
|
* This function is not available with the P3D renderer (<a
|
6468
6467
|
* href="http://code.google.com/p/processing/issues/detail?id=123">see
|
6469
6468
|
* Issue 123</a>). More information about the renderers can be found in the
|
6470
6469
|
* <b>size()</b> reference.
|
6471
6470
|
*
|
6472
|
-
|
6471
|
+
|
6473
6472
|
*
|
6474
6473
|
* @webref shape:attributes
|
6475
6474
|
* @param cap either SQUARE, PROJECT, or ROUND
|
@@ -6495,7 +6494,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6495
6494
|
* Disables drawing the stroke (outline). If both <b>noStroke()</b> and
|
6496
6495
|
* <b>noFill()</b> are called, nothing will be drawn to the screen.
|
6497
6496
|
*
|
6498
|
-
|
6497
|
+
|
6499
6498
|
*
|
6500
6499
|
* @webref color:setting
|
6501
6500
|
* @see PGraphics#stroke(int, float)
|
@@ -6514,7 +6513,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6514
6513
|
* is either specified in terms of the RGB or HSB color depending on the
|
6515
6514
|
* current <b>colorMode()</b> (the default color space is RGB, with each
|
6516
6515
|
* value in the range from 0 to 255).
|
6517
|
-
*
|
6516
|
+
*
|
6518
6517
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
6519
6518
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
6520
6519
|
* digits to specify a color (the way colors are specified in HTML and
|
@@ -6522,12 +6521,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
6522
6521
|
* hexadecimal value must be specified with eight characters; the first two
|
6523
6522
|
* characters define the alpha component and the remainder the red, green,
|
6524
6523
|
* and blue components.
|
6525
|
-
*
|
6524
|
+
*
|
6526
6525
|
* The value for the parameter "gray" must be less than or equal to the
|
6527
6526
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
6528
6527
|
* maximum value is 255.
|
6529
6528
|
*
|
6530
|
-
|
6529
|
+
|
6531
6530
|
*
|
6532
6531
|
* @param rgb color value in hexadecimal notation
|
6533
6532
|
* @see PGraphics#noStroke()
|
@@ -6615,7 +6614,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6615
6614
|
* Removes the current fill value for displaying images and reverts to
|
6616
6615
|
* displaying images with their original hues.
|
6617
6616
|
*
|
6618
|
-
|
6617
|
+
|
6619
6618
|
*
|
6620
6619
|
* @webref image:loading_displaying
|
6621
6620
|
* @usage web_application
|
@@ -6632,12 +6631,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
6632
6631
|
*
|
6633
6632
|
* Sets the fill value for displaying images. Images can be tinted to
|
6634
6633
|
* specified colors or made transparent by setting the alpha.
|
6635
|
-
*
|
6634
|
+
*
|
6636
6635
|
* To make an image transparent, but not change it's color, use white as
|
6637
6636
|
* the tint color and specify an alpha value. For instance, tint(255, 128)
|
6638
6637
|
* will make an image 50% transparent (unless <b>colorMode()</b> has been
|
6639
6638
|
* used).
|
6640
|
-
*
|
6639
|
+
*
|
6641
6640
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
6642
6641
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
6643
6642
|
* digits to specify a color (the way colors are specified in HTML and
|
@@ -6645,15 +6644,15 @@ public class PGraphics extends PImage implements PConstants {
|
|
6645
6644
|
* hexadecimal value must be specified with eight characters; the first two
|
6646
6645
|
* characters define the alpha component and the remainder the red, green,
|
6647
6646
|
* and blue components.
|
6648
|
-
*
|
6647
|
+
*
|
6649
6648
|
* The value for the parameter "gray" must be less than or equal to the
|
6650
6649
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
6651
6650
|
* maximum value is 255.
|
6652
|
-
*
|
6651
|
+
*
|
6653
6652
|
* The <b>tint()</b> function is also used to control the coloring of
|
6654
6653
|
* textures in 3D.
|
6655
6654
|
*
|
6656
|
-
|
6655
|
+
|
6657
6656
|
*
|
6658
6657
|
* @webref image:loading_displaying
|
6659
6658
|
* @usage web_application
|
@@ -6734,7 +6733,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6734
6733
|
* Disables filling geometry. If both <b>noStroke()</b> and <b>noFill()</b>
|
6735
6734
|
* are called, nothing will be drawn to the screen.
|
6736
6735
|
*
|
6737
|
-
|
6736
|
+
|
6738
6737
|
*
|
6739
6738
|
* @webref color:setting
|
6740
6739
|
* @usage web_application
|
@@ -6755,7 +6754,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6755
6754
|
* color is either specified in terms of the RGB or HSB color depending on
|
6756
6755
|
* the current <b>colorMode()</b> (the default color space is RGB, with
|
6757
6756
|
* each value in the range from 0 to 255).
|
6758
|
-
*
|
6757
|
+
*
|
6759
6758
|
* When using hexadecimal notation to specify a color, use "#" or "0x"
|
6760
6759
|
* before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
|
6761
6760
|
* digits to specify a color (the way colors are specified in HTML and
|
@@ -6763,14 +6762,14 @@ public class PGraphics extends PImage implements PConstants {
|
|
6763
6762
|
* hexadecimal value must be specified with eight characters; the first two
|
6764
6763
|
* characters define the alpha component and the remainder the red, green,
|
6765
6764
|
* and blue components.
|
6766
|
-
*
|
6765
|
+
*
|
6767
6766
|
* The value for the parameter "gray" must be less than or equal to the
|
6768
6767
|
* current maximum value as specified by <b>colorMode()</b>. The default
|
6769
6768
|
* maximum value is 255.
|
6770
|
-
*
|
6769
|
+
*
|
6771
6770
|
* To change the color of an image (or a texture), use tint().
|
6772
6771
|
*
|
6773
|
-
|
6772
|
+
|
6774
6773
|
*
|
6775
6774
|
* @webref color:setting
|
6776
6775
|
* @usage web_application
|
@@ -6859,7 +6858,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6859
6858
|
* reflect. Used in combination with <b>emissive()</b>, <b>specular()</b>,
|
6860
6859
|
* and <b>shininess()</b> in setting the material properties of shapes.
|
6861
6860
|
*
|
6862
|
-
|
6861
|
+
|
6863
6862
|
*
|
6864
6863
|
* @webref lights_camera:material_properties
|
6865
6864
|
* @usage web_application
|
@@ -6917,7 +6916,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6917
6916
|
* with <b>emissive()</b>, <b>ambient()</b>, and <b>shininess()</b> in
|
6918
6917
|
* setting the material properties of shapes.
|
6919
6918
|
*
|
6920
|
-
|
6919
|
+
|
6921
6920
|
*
|
6922
6921
|
* @webref lights_camera:material_properties
|
6923
6922
|
* @usage web_application
|
@@ -6977,7 +6976,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6977
6976
|
* with <b>ambient()</b>, <b>specular()</b>, and <b>emissive()</b> in
|
6978
6977
|
* setting the material properties of shapes.
|
6979
6978
|
*
|
6980
|
-
|
6979
|
+
|
6981
6980
|
*
|
6982
6981
|
* @webref lights_camera:material_properties
|
6983
6982
|
* @usage web_application
|
@@ -6998,7 +6997,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
6998
6997
|
* <b>specular()</b>, and <b>shininess()</b> in setting the material
|
6999
6998
|
* properties of shapes.
|
7000
6999
|
*
|
7001
|
-
|
7000
|
+
|
7002
7001
|
*
|
7003
7002
|
* @webref lights_camera:material_properties
|
7004
7003
|
* @usage web_application
|
@@ -7068,7 +7067,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7068
7067
|
* looping program will cause them to only have an effect the first time
|
7069
7068
|
* through the loop.
|
7070
7069
|
*
|
7071
|
-
|
7070
|
+
|
7072
7071
|
*
|
7073
7072
|
* @webref lights_camera:lights
|
7074
7073
|
* @usage web_application
|
@@ -7090,7 +7089,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7090
7089
|
* lighting so that 2D geometry (which does not require lighting) can be
|
7091
7090
|
* drawn after a set of lighted 3D geometry.
|
7092
7091
|
*
|
7093
|
-
|
7092
|
+
|
7094
7093
|
*
|
7095
7094
|
* @webref lights_camera:lights
|
7096
7095
|
* @usage web_application
|
@@ -7112,7 +7111,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7112
7111
|
* have an effect the first time through the loop. The effect of the
|
7113
7112
|
* parameters is determined by the current color mode.
|
7114
7113
|
*
|
7115
|
-
|
7114
|
+
|
7116
7115
|
*
|
7117
7116
|
* @webref lights_camera:lights
|
7118
7117
|
* @usage web_application
|
@@ -7153,7 +7152,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7153
7152
|
* direction the light is facing. For example, setting <b>ny</b> to -1 will
|
7154
7153
|
* cause the geometry to be lit from below (the light is facing directly upward).
|
7155
7154
|
*
|
7156
|
-
|
7155
|
+
|
7157
7156
|
*
|
7158
7157
|
* @webref lights_camera:lights
|
7159
7158
|
* @usage web_application
|
@@ -7184,7 +7183,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7184
7183
|
* mode. The <b>x</b>, <b>y</b>, and <b>z</b> parameters set the position
|
7185
7184
|
* of the light.
|
7186
7185
|
*
|
7187
|
-
|
7186
|
+
|
7188
7187
|
*
|
7189
7188
|
* @webref lights_camera:lights
|
7190
7189
|
* @usage web_application
|
@@ -7217,7 +7216,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7217
7216
|
* direction or light. The <b>angle</b> parameter affects angle of the
|
7218
7217
|
* spotlight cone.
|
7219
7218
|
*
|
7220
|
-
|
7219
|
+
|
7221
7220
|
*
|
7222
7221
|
* @webref lights_camera:lights
|
7223
7222
|
* @usage web_application
|
@@ -7260,7 +7259,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7260
7259
|
* and falloff. You can think of it as a point light that doesn't care
|
7261
7260
|
* which direction a surface is facing.
|
7262
7261
|
*
|
7263
|
-
|
7262
|
+
|
7264
7263
|
*
|
7265
7264
|
* @webref lights_camera:lights
|
7266
7265
|
* @usage web_application
|
@@ -7288,7 +7287,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7288
7287
|
* specular material qualities set through the <b>specular()</b> and
|
7289
7288
|
* <b>shininess()</b> functions.
|
7290
7289
|
*
|
7291
|
-
|
7290
|
+
|
7292
7291
|
*
|
7293
7292
|
* @webref lights_camera:lights
|
7294
7293
|
* @usage web_application
|
@@ -7319,27 +7318,27 @@ public class PGraphics extends PImage implements PConstants {
|
|
7319
7318
|
* of the Processing window. The default background is light gray. In the
|
7320
7319
|
* <b>draw()</b> function, the background color is used to clear the
|
7321
7320
|
* display window at the beginning of each frame.
|
7322
|
-
*
|
7321
|
+
*
|
7323
7322
|
* An image can also be used as the background for a sketch, however its
|
7324
7323
|
* width and height must be the same size as the sketch window. To resize
|
7325
7324
|
* an image 'b' to the size of the sketch window, use b.resize(width, height).
|
7326
|
-
*
|
7325
|
+
*
|
7327
7326
|
* Images used as background will ignore the current <b>tint()</b> setting.
|
7328
|
-
*
|
7327
|
+
*
|
7329
7328
|
* It is not possible to use transparency (alpha) in background colors with
|
7330
7329
|
* the main drawing surface, however they will work properly with <b>createGraphics()</b>.
|
7331
7330
|
*
|
7332
|
-
|
7331
|
+
|
7333
7332
|
*
|
7334
7333
|
* <h3>Advanced</h3>
|
7335
7334
|
* <p>Clear the background with a color that includes an alpha value. This can
|
7336
7335
|
* only be used with objects created by createGraphics(), because the main
|
7337
|
-
* drawing surface cannot be set transparent
|
7336
|
+
* drawing surface cannot be set transparent.
|
7338
7337
|
* <p>It might be tempting to use this function to partially clear the screen
|
7339
7338
|
* on each frame, however that's not how this function works. When calling
|
7340
7339
|
* background(), the pixels will be replaced with pixels that have that level
|
7341
7340
|
* of transparency. To do a semi-transparent overlay, use fill() with alpha
|
7342
|
-
* and draw a rectangle
|
7341
|
+
* and draw a rectangle.
|
7343
7342
|
*
|
7344
7343
|
* @webref color:setting
|
7345
7344
|
* @usage web_application
|
@@ -7457,12 +7456,12 @@ public class PGraphics extends PImage implements PConstants {
|
|
7457
7456
|
* Takes an RGB or ARGB image and sets it as the background.
|
7458
7457
|
* The width and height of the image must be the same size as the sketch.
|
7459
7458
|
* Use image.resize(width, height) to make short work of such a task.
|
7460
|
-
*
|
7459
|
+
*
|
7461
7460
|
* Note that even if the image is set as RGB, the high 8 bits of each pixel
|
7462
7461
|
* should be set opaque (0xFF000000) because the image data will be copied
|
7463
7462
|
* directly to the screen, and non-opaque background images may have strange
|
7464
7463
|
* behavior. Use image.filter(OPAQUE) to handle this easily.
|
7465
|
-
*
|
7464
|
+
*
|
7466
7465
|
* When using 3D, this will also clear the zbuffer (if it exists).
|
7467
7466
|
*
|
7468
7467
|
* @param image PImage to set as background (must be same size as the sketch window)
|
@@ -7549,7 +7548,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7549
7548
|
* are specified between 0 and 1. The limits for defining colors are
|
7550
7549
|
* altered by setting the parameters range1, range2, range3, and range 4.
|
7551
7550
|
*
|
7552
|
-
|
7551
|
+
|
7553
7552
|
*
|
7554
7553
|
* @webref color:setting
|
7555
7554
|
* @usage web_application
|
@@ -7887,7 +7886,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7887
7886
|
*
|
7888
7887
|
* Extracts the alpha value from a color.
|
7889
7888
|
*
|
7890
|
-
|
7889
|
+
|
7891
7890
|
* @webref color:creating_reading
|
7892
7891
|
* @usage web_application
|
7893
7892
|
* @param rgb any value of the color datatype
|
@@ -7918,7 +7917,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7918
7917
|
* /><pre>float r1 = red(myColor);float r2 = myColor >> 16
|
7919
7918
|
* & 0xFF;</pre>
|
7920
7919
|
*
|
7921
|
-
|
7920
|
+
|
7922
7921
|
*
|
7923
7922
|
* @webref color:creating_reading
|
7924
7923
|
* @usage web_application
|
@@ -7951,7 +7950,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7951
7950
|
* are equivalent:<pre>float r1 = green(myColor);float r2 =
|
7952
7951
|
* myColor >> 8 & 0xFF;</pre>
|
7953
7952
|
*
|
7954
|
-
|
7953
|
+
|
7955
7954
|
*
|
7956
7955
|
* @webref color:creating_reading
|
7957
7956
|
* @usage web_application
|
@@ -7984,7 +7983,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
7984
7983
|
* equivalent:<pre>float r1 = blue(myColor);float r2 = myColor
|
7985
7984
|
* & 0xFF;</pre>
|
7986
7985
|
*
|
7987
|
-
|
7986
|
+
|
7988
7987
|
*
|
7989
7988
|
* @webref color:creating_reading
|
7990
7989
|
* @usage web_application
|
@@ -8062,7 +8061,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8062
8061
|
* Extracts the brightness value from a color.( end auto-generated )
|
8063
8062
|
*
|
8064
8063
|
*
|
8065
|
-
* @return
|
8064
|
+
* @return
|
8066
8065
|
* @webref color:creating_reading
|
8067
8066
|
* @usage web_application
|
8068
8067
|
* @param rgb any value of the color datatype
|
@@ -8099,7 +8098,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8099
8098
|
* values where 0.0 equal to the first point, 0.1 is very near the first
|
8100
8099
|
* point, 0.5 is half-way in between, etc.
|
8101
8100
|
*
|
8102
|
-
|
8101
|
+
|
8103
8102
|
*
|
8104
8103
|
* @webref color:creating_reading
|
8105
8104
|
* @usage web_application
|
@@ -8365,7 +8364,7 @@ public class PGraphics extends PImage implements PConstants {
|
|
8365
8364
|
* Return true if this renderer should be drawn to the screen. Defaults to
|
8366
8365
|
* returning true, since nearly all renderers are on-screen beasts. But can
|
8367
8366
|
* be overridden for subclasses like PDF so that a window doesn't open up.
|
8368
|
-
*
|
8367
|
+
*
|
8369
8368
|
* A better name? showFrame, displayable, isVisible, visible, shouldDisplay,
|
8370
8369
|
* what to call this?
|
8371
8370
|
*/
|