From f594ff374666d7efbfe0e1f47aaa8536b545b5be Mon Sep 17 00:00:00 2001 From: Casey Reas Date: Tue, 20 Nov 2012 21:40:43 +0000 Subject: [PATCH] Reference edits for 2.0, text corrections --- core/src/processing/opengl/PShader.java | 2 +- java/examples/Basics/Arrays/Array/Array.pde | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/processing/opengl/PShader.java b/core/src/processing/opengl/PShader.java index 69929576f..15c263cfb 100644 --- a/core/src/processing/opengl/PShader.java +++ b/core/src/processing/opengl/PShader.java @@ -273,7 +273,7 @@ public class PShader { } /** - * @param vec modifies all the components of an array/vector uniform variable. PVector can be only be used if the type of the variable is vec3. + * @param vec modifies all the components of an array/vector uniform variable. PVector can only be used if the type of the variable is vec3. */ public void set(String name, PVector vec) { setUniformImpl(name, UniformValue.FLOAT3, diff --git a/java/examples/Basics/Arrays/Array/Array.pde b/java/examples/Basics/Arrays/Array/Array.pde index 4bafa8033..c060b476c 100644 --- a/java/examples/Basics/Arrays/Array/Array.pde +++ b/java/examples/Basics/Arrays/Array/Array.pde @@ -20,6 +20,7 @@ void setup() { float amount = map(i, 0, width, 0, PI); coswave[i] = abs(cos(amount)); } + background(255); noLoop(); } @@ -27,21 +28,21 @@ void draw() { int y1 = 0; int y2 = height/3; - for (int i = 0; i < width; i++) { + for (int i = 0; i < width; i+=2) { stroke(coswave[i]*255); line(i, y1, i, y2); } y1 = y2; y2 = y1 + y1; - for (int i = 0; i < width; i++) { + for (int i = 0; i < width; i+=2) { stroke(coswave[i]*255 / 4); line(i, y1, i, y2); } y1 = y2; y2 = height; - for (int i = 0; i < width; i++) { + for (int i = 0; i < width; i+=2) { stroke(255 - coswave[i]*255); line(i, y1, i, y2); }