@@ -149,7 +149,7 @@ export class Matrix extends MatrixInterface {
149
149
* // Now the matrix values are [1, 2, 99, 4]
150
150
*
151
151
* // p5.js script example
152
- * <div><code>
152
+ * <div class="norender" ><code>
153
153
* function setup() {
154
154
*
155
155
* const matrix = new p5.Matrix([1, 2, 3, 4]);
@@ -183,7 +183,7 @@ export class Matrix extends MatrixInterface {
183
183
* console.log(matrix.matrix); // Output: Identity matrix
184
184
*
185
185
* // p5.js script example
186
- * <div><code>
186
+ * <div class="norender" ><code>
187
187
* function setup() {
188
188
*
189
189
* const matrix = new p5.Matrix(4);
@@ -235,7 +235,7 @@ export class Matrix extends MatrixInterface {
235
235
* console.log(matrix.matrix); // Output: [1, 2, 3, ..., 16]
236
236
*
237
237
* // p5.js script example
238
- * <div><code>
238
+ * <div class="norender" ><code>
239
239
* function setup() {
240
240
*
241
241
* const matrix = new p5.Matrix([1, 2, 3, 4]);
@@ -278,7 +278,7 @@ export class Matrix extends MatrixInterface {
278
278
*
279
279
* @example
280
280
* // p5.js script example
281
- * <div><code>
281
+ * <div class="norender" ><code>
282
282
* function setup() {
283
283
*
284
284
* const originalMatrix = new p5.Matrix([1, 2, 3, 4]);
@@ -310,7 +310,7 @@ export class Matrix extends MatrixInterface {
310
310
*
311
311
* @example
312
312
* // p5.js script example
313
- * <div><code>
313
+ * <div class="norender" ><code>
314
314
* function setup() {
315
315
*
316
316
* const originalMatrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -338,7 +338,7 @@ export class Matrix extends MatrixInterface {
338
338
*
339
339
* @example
340
340
* // p5.js script example
341
- * <div><code>
341
+ * <div class="norender" ><code>
342
342
* function setup() {
343
343
*
344
344
* const originalMatrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -385,7 +385,7 @@ export class Matrix extends MatrixInterface {
385
385
* const diagonal = matrix.diagonal(); // [1, 5, 9]
386
386
*
387
387
* // p5.js script example
388
- * <div><code>
388
+ * <div class="norender" ><code>
389
389
* function setup() {
390
390
*
391
391
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -420,7 +420,7 @@ export class Matrix extends MatrixInterface {
420
420
* const rowVector = matrix.row(1); // Returns a vector [2, 5, 8]
421
421
*
422
422
* // p5.js script example
423
- * <div><code>
423
+ * <div class="norender" ><code>
424
424
* function setup() {
425
425
*
426
426
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -455,7 +455,7 @@ export class Matrix extends MatrixInterface {
455
455
* const columnVector = matrix.column(1); // Returns a vector [4, 5, 6]
456
456
*
457
457
* // p5.js script example
458
- * <div><code>
458
+ * <div class="norender" ><code>
459
459
* function setup() {
460
460
*
461
461
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -498,7 +498,7 @@ export class Matrix extends MatrixInterface {
498
498
* console.log(matrix4x4.matrix); // Output: Transposed 4x4 identity matrix
499
499
*
500
500
* // p5.js script example
501
- * <div><code>
501
+ * <div class="norender" ><code>
502
502
* function setup() {
503
503
*
504
504
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -549,7 +549,7 @@ export class Matrix extends MatrixInterface {
549
549
* console.log(matrix4x4_1.matrix); // Output: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1]
550
550
*
551
551
* // p5.js script example
552
- * <div><code>
552
+ * <div class="norender" ><code>
553
553
* function setup() {
554
554
*
555
555
* const matrix1 = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -602,7 +602,7 @@ export class Matrix extends MatrixInterface {
602
602
* console.log(result.toString()); // Output: Transformed vector
603
603
*
604
604
* // p5.js script example
605
- * <div><code>
605
+ * <div class="norender" ><code>
606
606
* function setup() {
607
607
*
608
608
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -651,7 +651,7 @@ export class Matrix extends MatrixInterface {
651
651
* console.log(invertedMatrix4x4.matrix); // Output: Inverted 4x4 matrix
652
652
*
653
653
* // p5.js script example
654
- * <div><code>
654
+ * <div class="norender" ><code>
655
655
* function setup() {
656
656
*
657
657
* const matrix = new p5.Matrix([1, 2, 3, 0, 1, 4, 5, 6, 0]);
@@ -700,7 +700,7 @@ export class Matrix extends MatrixInterface {
700
700
* console.log("Extracted 3x3 Submatrix:", subMatrix3x3.matrix);
701
701
*
702
702
* // p5.js script example
703
- * <div><code>
703
+ * <div class="norender" ><code>
704
704
* function setup() {
705
705
*
706
706
* const matrix4x4 = new p5.Matrix(4); // Creates a 4x4 identity matrix
@@ -752,7 +752,7 @@ export class Matrix extends MatrixInterface {
752
752
* console.log("Converted 3×3 Matrix:", mat3.matrix);
753
753
*
754
754
* // p5.js script example
755
- * <div><code>
755
+ * <div class="norender" ><code>
756
756
* function setup() {
757
757
*
758
758
* const mat4 = new p5.Matrix(4); // Create a 4×4 identity matrix
@@ -826,7 +826,7 @@ export class Matrix extends MatrixInterface {
826
826
* matrix.apply(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
827
827
*
828
828
* // p5.js script example
829
- * <div><code>
829
+ * <div class="norender" ><code>
830
830
* function setup() {
831
831
*
832
832
* // Create a 4x4 identity matrix
@@ -936,7 +936,7 @@ export class Matrix extends MatrixInterface {
936
936
* console.log(matrix.matrix);
937
937
*
938
938
* // p5.js script example
939
- * <div><code>
939
+ * <div class="norender" ><code>
940
940
* function setup() {
941
941
*
942
942
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1080,7 +1080,7 @@ export class Matrix extends MatrixInterface {
1080
1080
* console.log(matrix.matrix);
1081
1081
*
1082
1082
* // p5.js script example
1083
- * <div><code>
1083
+ * <div class="norender" ><code>
1084
1084
* function setup() {
1085
1085
*
1086
1086
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1130,7 +1130,7 @@ export class Matrix extends MatrixInterface {
1130
1130
* console.log(matrix.matrix);
1131
1131
*
1132
1132
* // p5.js script example
1133
- * <div><code>
1133
+ * <div class="norender" ><code>
1134
1134
* function setup() {
1135
1135
*
1136
1136
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1167,7 +1167,7 @@ export class Matrix extends MatrixInterface {
1167
1167
* console.log(matrix.matrix);
1168
1168
*
1169
1169
* // p5.js script example
1170
- * <div><code>
1170
+ * <div class="norender" ><code>
1171
1171
* function setup() {
1172
1172
*
1173
1173
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1206,7 +1206,7 @@ export class Matrix extends MatrixInterface {
1206
1206
* console.log(matrix.matrix);
1207
1207
*
1208
1208
* // p5.js script example
1209
- * <div><code>
1209
+ * <div class="norender" ><code>
1210
1210
* function setup() {
1211
1211
*
1212
1212
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1247,7 +1247,7 @@ export class Matrix extends MatrixInterface {
1247
1247
* console.log(matrix.matrix);
1248
1248
*
1249
1249
* // p5.js script example
1250
- * <div><code>
1250
+ * <div class="norender" ><code>
1251
1251
* function setup() {
1252
1252
*
1253
1253
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1302,11 +1302,10 @@ export class Matrix extends MatrixInterface {
1302
1302
* @returns {Matrix } The current matrix instance, updated with the orthographic projection.
1303
1303
*
1304
1304
* @example
1305
- * <div><code>
1305
+ * <div class="norender" ><code>
1306
1306
* // Example using p5.js to demonstrate orthographic projection
1307
1307
* function setup() {
1308
- * createCanvas(400, 400, WEBGL);
1309
- * let orthoMatrix = new p5.Matrix();
1308
+ * let orthoMatrix = new p5.Matrix(4);
1310
1309
* orthoMatrix.ortho(-200, 200, -200, 200, 0.1, 1000);
1311
1310
* applyMatrix(
1312
1311
* orthoMatrix.mat4[0], orthoMatrix.mat4[1], orthoMatrix.mat4[2], orthoMatrix.mat4[3],
@@ -1316,21 +1315,8 @@ export class Matrix extends MatrixInterface {
1316
1315
* );
1317
1316
* }
1318
1317
*
1319
- * function draw() {
1320
- * background(200);
1321
- * rotateX(frameCount * 0.01);
1322
- * rotateY(frameCount * 0.01);
1323
- * box(100);
1324
- * }
1325
1318
* </code></div>
1326
1319
*
1327
- * This example demonstrates how to use an orthographic projection matrix
1328
- * in a p5.js sketch. The `ortho` method is used to define the projection
1329
- * parameters, and the resulting matrix is applied to the 3D rendering context.
1330
- *
1331
- * Note: While working on any features of p5.js, it is important to keep in mind
1332
- * the design principles of p5.js, including accessibility, beginner-friendliness,
1333
- * educational focus, and alignment with the JavaScript and Processing communities.
1334
1320
*/
1335
1321
ortho ( left , right , bottom , top , near , far ) {
1336
1322
const lr = 1 / ( left - right ) ,
@@ -1377,7 +1363,7 @@ export class Matrix extends MatrixInterface {
1377
1363
* console.log(result); // Output: [1, 2, 3, 1] (unchanged for identity matrix)
1378
1364
*
1379
1365
* // p5.js script example
1380
- * <div><code>
1366
+ * <div class="norender" ><code>
1381
1367
* function setup() {
1382
1368
*
1383
1369
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1433,7 +1419,7 @@ export class Matrix extends MatrixInterface {
1433
1419
* console.log(transformedPoint.toString()); // Output: [1, 2, 3] (unchanged for identity matrix)
1434
1420
*
1435
1421
* // p5.js script example
1436
- * <div><code>
1422
+ * <div class="norender" ><code>
1437
1423
* function setup() {
1438
1424
*
1439
1425
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1486,7 +1472,7 @@ export class Matrix extends MatrixInterface {
1486
1472
* console.log(transformedPoint.toString()); // Output: [1, 2, 3] (unchanged for identity matrix)
1487
1473
*
1488
1474
* // p5.js script example
1489
- * <div><code>
1475
+ * <div class="norender" ><code>
1490
1476
* function setup() {
1491
1477
*
1492
1478
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1541,7 +1527,7 @@ export class Matrix extends MatrixInterface {
1541
1527
* console.log(transformedDirection.toString()); // Output: [1, 0, 0] (unchanged for identity matrix)
1542
1528
*
1543
1529
* // p5.js script example
1544
- * <div><code>
1530
+ * <div class="norender" ><code>
1545
1531
* function setup() {
1546
1532
*
1547
1533
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1594,7 +1580,7 @@ export class Matrix extends MatrixInterface {
1594
1580
* console.log(result.toString()); // Output: Transformed vector
1595
1581
*
1596
1582
* // p5.js script example
1597
- * <div><code>
1583
+ * <div class="norender" ><code>
1598
1584
* function setup() {
1599
1585
*
1600
1586
* // Create a 3x3 matrix
0 commit comments