Skip to content

Commit 72955e4

Browse files
committed
p5.Matrix no render
1 parent f9af4f7 commit 72955e4

File tree

1 file changed

+29
-43
lines changed

1 file changed

+29
-43
lines changed

src/math/Matrices/Matrix.js

Lines changed: 29 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class Matrix extends MatrixInterface {
149149
* // Now the matrix values are [1, 2, 99, 4]
150150
*
151151
* // p5.js script example
152-
* <div><code>
152+
* <div class="norender"><code>
153153
* function setup() {
154154
*
155155
* const matrix = new p5.Matrix([1, 2, 3, 4]);
@@ -183,7 +183,7 @@ export class Matrix extends MatrixInterface {
183183
* console.log(matrix.matrix); // Output: Identity matrix
184184
*
185185
* // p5.js script example
186-
* <div><code>
186+
* <div class="norender"><code>
187187
* function setup() {
188188
*
189189
* const matrix = new p5.Matrix(4);
@@ -235,7 +235,7 @@ export class Matrix extends MatrixInterface {
235235
* console.log(matrix.matrix); // Output: [1, 2, 3, ..., 16]
236236
*
237237
* // p5.js script example
238-
* <div><code>
238+
* <div class="norender"><code>
239239
* function setup() {
240240
*
241241
* const matrix = new p5.Matrix([1, 2, 3, 4]);
@@ -278,7 +278,7 @@ export class Matrix extends MatrixInterface {
278278
*
279279
* @example
280280
* // p5.js script example
281-
* <div><code>
281+
* <div class="norender"><code>
282282
* function setup() {
283283
*
284284
* const originalMatrix = new p5.Matrix([1, 2, 3, 4]);
@@ -310,7 +310,7 @@ export class Matrix extends MatrixInterface {
310310
*
311311
* @example
312312
* // p5.js script example
313-
* <div><code>
313+
* <div class="norender"><code>
314314
* function setup() {
315315
*
316316
* const originalMatrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -338,7 +338,7 @@ export class Matrix extends MatrixInterface {
338338
*
339339
* @example
340340
* // p5.js script example
341-
* <div><code>
341+
* <div class="norender"><code>
342342
* function setup() {
343343
*
344344
* const originalMatrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -385,7 +385,7 @@ export class Matrix extends MatrixInterface {
385385
* const diagonal = matrix.diagonal(); // [1, 5, 9]
386386
*
387387
* // p5.js script example
388-
* <div><code>
388+
* <div class="norender"><code>
389389
* function setup() {
390390
*
391391
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -420,7 +420,7 @@ export class Matrix extends MatrixInterface {
420420
* const rowVector = matrix.row(1); // Returns a vector [2, 5, 8]
421421
*
422422
* // p5.js script example
423-
* <div><code>
423+
* <div class="norender"><code>
424424
* function setup() {
425425
*
426426
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -455,7 +455,7 @@ export class Matrix extends MatrixInterface {
455455
* const columnVector = matrix.column(1); // Returns a vector [4, 5, 6]
456456
*
457457
* // p5.js script example
458-
* <div><code>
458+
* <div class="norender"><code>
459459
* function setup() {
460460
*
461461
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -498,7 +498,7 @@ export class Matrix extends MatrixInterface {
498498
* console.log(matrix4x4.matrix); // Output: Transposed 4x4 identity matrix
499499
*
500500
* // p5.js script example
501-
* <div><code>
501+
* <div class="norender"><code>
502502
* function setup() {
503503
*
504504
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -549,7 +549,7 @@ export class Matrix extends MatrixInterface {
549549
* console.log(matrix4x4_1.matrix); // Output: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1]
550550
*
551551
* // p5.js script example
552-
* <div><code>
552+
* <div class="norender"><code>
553553
* function setup() {
554554
*
555555
* const matrix1 = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -602,7 +602,7 @@ export class Matrix extends MatrixInterface {
602602
* console.log(result.toString()); // Output: Transformed vector
603603
*
604604
* // p5.js script example
605-
* <div><code>
605+
* <div class="norender"><code>
606606
* function setup() {
607607
*
608608
* const matrix = new p5.Matrix([1, 2, 3, 4, 5, 6, 7, 8, 9]);
@@ -651,7 +651,7 @@ export class Matrix extends MatrixInterface {
651651
* console.log(invertedMatrix4x4.matrix); // Output: Inverted 4x4 matrix
652652
*
653653
* // p5.js script example
654-
* <div><code>
654+
* <div class="norender"><code>
655655
* function setup() {
656656
*
657657
* const matrix = new p5.Matrix([1, 2, 3, 0, 1, 4, 5, 6, 0]);
@@ -700,7 +700,7 @@ export class Matrix extends MatrixInterface {
700700
* console.log("Extracted 3x3 Submatrix:", subMatrix3x3.matrix);
701701
*
702702
* // p5.js script example
703-
* <div><code>
703+
* <div class="norender"><code>
704704
* function setup() {
705705
*
706706
* const matrix4x4 = new p5.Matrix(4); // Creates a 4x4 identity matrix
@@ -752,7 +752,7 @@ export class Matrix extends MatrixInterface {
752752
* console.log("Converted 3×3 Matrix:", mat3.matrix);
753753
*
754754
* // p5.js script example
755-
* <div><code>
755+
* <div class="norender"><code>
756756
* function setup() {
757757
*
758758
* const mat4 = new p5.Matrix(4); // Create a 4×4 identity matrix
@@ -826,7 +826,7 @@ export class Matrix extends MatrixInterface {
826826
* matrix.apply(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
827827
*
828828
* // p5.js script example
829-
* <div><code>
829+
* <div class="norender"><code>
830830
* function setup() {
831831
*
832832
* // Create a 4x4 identity matrix
@@ -936,7 +936,7 @@ export class Matrix extends MatrixInterface {
936936
* console.log(matrix.matrix);
937937
*
938938
* // p5.js script example
939-
* <div><code>
939+
* <div class="norender"><code>
940940
* function setup() {
941941
*
942942
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1080,7 +1080,7 @@ export class Matrix extends MatrixInterface {
10801080
* console.log(matrix.matrix);
10811081
*
10821082
* // p5.js script example
1083-
* <div><code>
1083+
* <div class="norender"><code>
10841084
* function setup() {
10851085
*
10861086
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1130,7 +1130,7 @@ export class Matrix extends MatrixInterface {
11301130
* console.log(matrix.matrix);
11311131
*
11321132
* // p5.js script example
1133-
* <div><code>
1133+
* <div class="norender"><code>
11341134
* function setup() {
11351135
*
11361136
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1167,7 +1167,7 @@ export class Matrix extends MatrixInterface {
11671167
* console.log(matrix.matrix);
11681168
*
11691169
* // p5.js script example
1170-
* <div><code>
1170+
* <div class="norender"><code>
11711171
* function setup() {
11721172
*
11731173
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1206,7 +1206,7 @@ export class Matrix extends MatrixInterface {
12061206
* console.log(matrix.matrix);
12071207
*
12081208
* // p5.js script example
1209-
* <div><code>
1209+
* <div class="norender"><code>
12101210
* function setup() {
12111211
*
12121212
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1247,7 +1247,7 @@ export class Matrix extends MatrixInterface {
12471247
* console.log(matrix.matrix);
12481248
*
12491249
* // p5.js script example
1250-
* <div><code>
1250+
* <div class="norender"><code>
12511251
* function setup() {
12521252
*
12531253
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1302,11 +1302,10 @@ export class Matrix extends MatrixInterface {
13021302
* @returns {Matrix} The current matrix instance, updated with the orthographic projection.
13031303
*
13041304
* @example
1305-
* <div><code>
1305+
* <div class="norender"><code>
13061306
* // Example using p5.js to demonstrate orthographic projection
13071307
* function setup() {
1308-
* createCanvas(400, 400, WEBGL);
1309-
* let orthoMatrix = new p5.Matrix();
1308+
* let orthoMatrix = new p5.Matrix(4);
13101309
* orthoMatrix.ortho(-200, 200, -200, 200, 0.1, 1000);
13111310
* applyMatrix(
13121311
* orthoMatrix.mat4[0], orthoMatrix.mat4[1], orthoMatrix.mat4[2], orthoMatrix.mat4[3],
@@ -1316,21 +1315,8 @@ export class Matrix extends MatrixInterface {
13161315
* );
13171316
* }
13181317
*
1319-
* function draw() {
1320-
* background(200);
1321-
* rotateX(frameCount * 0.01);
1322-
* rotateY(frameCount * 0.01);
1323-
* box(100);
1324-
* }
13251318
* </code></div>
13261319
*
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.
13341320
*/
13351321
ortho(left, right, bottom, top, near, far) {
13361322
const lr = 1 / (left - right),
@@ -1377,7 +1363,7 @@ export class Matrix extends MatrixInterface {
13771363
* console.log(result); // Output: [1, 2, 3, 1] (unchanged for identity matrix)
13781364
*
13791365
* // p5.js script example
1380-
* <div><code>
1366+
* <div class="norender"><code>
13811367
* function setup() {
13821368
*
13831369
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1433,7 +1419,7 @@ export class Matrix extends MatrixInterface {
14331419
* console.log(transformedPoint.toString()); // Output: [1, 2, 3] (unchanged for identity matrix)
14341420
*
14351421
* // p5.js script example
1436-
* <div><code>
1422+
* <div class="norender"><code>
14371423
* function setup() {
14381424
*
14391425
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1486,7 +1472,7 @@ export class Matrix extends MatrixInterface {
14861472
* console.log(transformedPoint.toString()); // Output: [1, 2, 3] (unchanged for identity matrix)
14871473
*
14881474
* // p5.js script example
1489-
* <div><code>
1475+
* <div class="norender"><code>
14901476
* function setup() {
14911477
*
14921478
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1541,7 +1527,7 @@ export class Matrix extends MatrixInterface {
15411527
* console.log(transformedDirection.toString()); // Output: [1, 0, 0] (unchanged for identity matrix)
15421528
*
15431529
* // p5.js script example
1544-
* <div><code>
1530+
* <div class="norender"><code>
15451531
* function setup() {
15461532
*
15471533
* const matrix = new p5.Matrix(4); // Create a 4x4 identity matrix
@@ -1594,7 +1580,7 @@ export class Matrix extends MatrixInterface {
15941580
* console.log(result.toString()); // Output: Transformed vector
15951581
*
15961582
* // p5.js script example
1597-
* <div><code>
1583+
* <div class="norender"><code>
15981584
* function setup() {
15991585
*
16001586
* // Create a 3x3 matrix

0 commit comments

Comments
 (0)