@@ -142,18 +142,18 @@ function acceleration(p5, fn){
142142 * @example
143143 * <div>
144144 * <code>
145+ * let rotationX = 0; // Angle in degrees
146+ *
145147 * function setup() {
146- * createCanvas(100, 100 , WEBGL);
148+ * createCanvas(200, 200 , WEBGL); // Create 3D canvas
147149 * }
148150 *
149151 * function draw() {
150- * background(200);
151- * //rotateZ(radians(rotationZ));
152- * rotateX(radians(rotationX));
153- * //rotateY(radians(rotationY));
154- * box(200, 200, 200);
155- * describe(`red horizontal line right, green vertical line bottom.
156- * black background.`);
152+ * background(220); // Set light gray background
153+ * rotateX(radians(rotationX)); // Rotate around X-axis
154+ * normalMaterial(); // Apply simple shaded material
155+ * box(60); // Draw 3D cube (60 units wide)
156+ * rotationX = (rotationX + 2) % 360; // Increment rotation (2° per frame)
157157 * }
158158 * </code>
159159 * </div>
@@ -175,18 +175,18 @@ function acceleration(p5, fn){
175175 * @example
176176 * <div>
177177 * <code>
178+ * let rotationY = 0; // Angle in degrees
179+ *
178180 * function setup() {
179- * createCanvas(100, 100 , WEBGL);
181+ * createCanvas(200, 200 , WEBGL); // Create 3D canvas
180182 * }
181183 *
182184 * function draw() {
183- * background(200);
184- * //rotateZ(radians(rotationZ));
185- * //rotateX(radians(rotationX));
186- * rotateY(radians(rotationY));
187- * box(200, 200, 200);
188- * describe(`red horizontal line right, green vertical line bottom.
189- * black background.`);
185+ * background(220); // Set light gray background
186+ * rotateY(radians(rotationY)); // Rotate around Y-axis (vertical)
187+ * normalMaterial(); // Apply simple shaded material
188+ * box(60); // Draw 3D cube (60 units wide)
189+ * rotationY = (rotationY + 2) % 360; // Increment rotation (2° per frame)
190190 * }
191191 * </code>
192192 * </div>
@@ -209,18 +209,18 @@ function acceleration(p5, fn){
209209 * @example
210210 * <div>
211211 * <code>
212+ * let rotationZ = 0; // Angle in degrees
213+ *
212214 * function setup() {
213- * createCanvas(100, 100 , WEBGL);
215+ * createCanvas(200, 200 , WEBGL); // Create 3D canvas
214216 * }
215217 *
216218 * function draw() {
217- * background(200);
218- * rotateZ(radians(rotationZ));
219- * //rotateX(radians(rotationX));
220- * //rotateY(radians(rotationY));
221- * box(200, 200, 200);
222- * describe(`red horizontal line right, green vertical line bottom.
223- * black background.`);
219+ * background(220);
220+ * rotateZ(radians(rotationZ)); // Rotate around Z-axis
221+ * normalMaterial(); // Apply simple shaded material
222+ * box(60); // Draw 3D cube
223+ * rotationZ = (rotationZ + 2) % 360; // Increment rotation angle
224224 * }
225225 * </code>
226226 * </div>
0 commit comments