File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -2300,6 +2300,46 @@ function customShapes(p5, fn) {
2300
2300
* }
2301
2301
* </code>
2302
2302
* </div>
2303
+ *
2304
+ * <div>
2305
+ * <code>
2306
+ * let vid;
2307
+ * function setup() {
2308
+ * // Load a video and create a p5.MediaElement object.
2309
+ * vid = createVideo('/assets/fingers.mov');
2310
+ * createCanvas(100, 100, WEBGL);
2311
+ *
2312
+ * // Hide the video.
2313
+ * vid.hide();
2314
+ *
2315
+ * // Set the video to loop.
2316
+ * vid.loop();
2317
+ *
2318
+ * describe('A rectangle with video as texture');
2319
+ * }
2320
+ *
2321
+ * function draw() {
2322
+ * background(0);
2323
+ *
2324
+ * // Rotate around the y-axis.
2325
+ * rotateY(frameCount * 0.01);
2326
+ *
2327
+ * // Set the texture mode.
2328
+ * textureMode(NORMAL);
2329
+ *
2330
+ * // Apply the video as a texture.
2331
+ * texture(vid);
2332
+ *
2333
+ * // Draw a custom shape using uv coordinates.
2334
+ * beginShape();
2335
+ * vertex(-40, -40, 0, 0);
2336
+ * vertex(40, -40, 1, 0);
2337
+ * vertex(40, 40, 1, 1);
2338
+ * vertex(-40, 40, 0, 1);
2339
+ * endShape();
2340
+ * }
2341
+ * </code>
2342
+ * </div>
2303
2343
*/
2304
2344
/**
2305
2345
* @method vertex
You can’t perform that action at this time.
0 commit comments