Skip to content

Commit 55db905

Browse files
authored
Merge pull request #7607 from webermayank/webermayank/setCamera/docs
Update examples that use createCamera() to explicitly call setCamera()
2 parents cbc4498 + 987a14a commit 55db905

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

src/webgl/p5.Camera.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class Camera {
4141
* // Create a p5.Camera object.
4242
* cam = createCamera();
4343
*
44+
* // Set the camera
45+
* setCamera(cam);
46+
*
4447
* // Place the camera at the top-center.
4548
* cam.setPosition(0, -400, 800);
4649
*
@@ -86,6 +89,9 @@ class Camera {
8689
* // Create a p5.Camera object.
8790
* cam = createCamera();
8891
*
92+
* // Set the camera
93+
* setCamera(cam);
94+
*
8995
* // Place the camera at the top-center.
9096
* cam.setPosition(0, -400, 800);
9197
*
@@ -192,6 +198,9 @@ class Camera {
192198
* // Create a p5.Camera object.
193199
* cam = createCamera();
194200
*
201+
* // Set the camera
202+
* setCamera(cam);
203+
*
195204
* // Place the camera at the top-center.
196205
* cam.setPosition(0, -400, 800);
197206
*
@@ -253,6 +262,9 @@ class Camera {
253262
* // Create a p5.Camera object.
254263
* cam = createCamera();
255264
*
265+
* // Set the camera
266+
* setCamera(cam);
267+
*
256268
* // Place the camera at the top-center.
257269
* cam.setPosition(0, -400, 800);
258270
*
@@ -298,6 +310,9 @@ class Camera {
298310
* // Create a p5.Camera object.
299311
* cam = createCamera();
300312
*
313+
* // Set the camera
314+
* setCamera(cam);
315+
*
301316
* // Place the camera at the top-center.
302317
* cam.setPosition(0, -400, 800);
303318
*
@@ -360,6 +375,9 @@ class Camera {
360375
* // Create a p5.Camera object.
361376
* cam = createCamera();
362377
*
378+
* // Set the camera
379+
* setCamera(cam);
380+
*
363381
* // Place the camera at the top-center.
364382
* cam.setPosition(0, -400, 800);
365383
*
@@ -405,6 +423,9 @@ class Camera {
405423
* // Create a p5.Camera object.
406424
* cam = createCamera();
407425
*
426+
* // Set the camera
427+
* setCamera(cam);
428+
*
408429
* // Place the camera at the top-right.
409430
* cam.setPosition(100, -400, 800);
410431
*
@@ -467,6 +488,9 @@ class Camera {
467488
* // Create a p5.Camera object.
468489
* cam = createCamera();
469490
*
491+
* // Set the camera
492+
* setCamera(cam);
493+
*
470494
* // Place the camera at the top-center.
471495
* cam.setPosition(0, -400, 800);
472496
*
@@ -512,6 +536,9 @@ class Camera {
512536
* // Create a p5.Camera object.
513537
* cam = createCamera();
514538
*
539+
* // Set the camera
540+
* setCamera(cam);
541+
*
515542
* // Place the camera at the top-right.
516543
* cam.setPosition(100, -400, 800);
517544
*
@@ -574,6 +601,9 @@ class Camera {
574601
* // Create a p5.Camera object.
575602
* cam = createCamera();
576603
*
604+
* // Set the camera
605+
* setCamera(cam);
606+
*
577607
* // Place the camera at the top-center.
578608
* cam.setPosition(0, -400, 800);
579609
*
@@ -619,6 +649,9 @@ class Camera {
619649
* // Create a p5.Camera object.
620650
* cam = createCamera();
621651
*
652+
* // Set the camera
653+
* setCamera(cam);
654+
*
622655
* // Place the camera at the top-right.
623656
* cam.setPosition(100, -400, 800);
624657
*
@@ -681,6 +714,9 @@ class Camera {
681714
* // Create a p5.Camera object.
682715
* cam = createCamera();
683716
*
717+
* // Set the camera
718+
* setCamera(cam);
719+
*
684720
* // Place the camera at the top-right: (100, -400, 800)
685721
* // Point it at the origin: (0, 0, 0)
686722
* // Set its "up" vector: (0, 1, 0).
@@ -725,6 +761,9 @@ class Camera {
725761
* // Create a p5.Camera object.
726762
* cam = createCamera();
727763
*
764+
* // Set the camera
765+
* setCamera(cam);
766+
*
728767
* // Place the camera at the top-right: (100, -400, 800)
729768
* // Point it at the origin: (0, 0, 0)
730769
* // Set its "up" vector: (0, 1, 0).
@@ -786,6 +825,9 @@ class Camera {
786825
* // Create a p5.Camera object.
787826
* cam = createCamera();
788827
*
828+
* // Set the camera
829+
* setCamera(cam);
830+
*
789831
* // Place the camera at the top-right: (100, -400, 800)
790832
* // Point it at the origin: (0, 0, 0)
791833
* // Set its "up" vector: (0, 1, 0).
@@ -830,6 +872,9 @@ class Camera {
830872
* // Create a p5.Camera object.
831873
* cam = createCamera();
832874
*
875+
* // Set the camera
876+
* setCamera(cam);
877+
*
833878
* // Place the camera at the top-right: (100, -400, 800)
834879
* // Point it at the origin: (0, 0, 0)
835880
* // Set its "up" vector: (0, 1, 0).
@@ -891,6 +936,9 @@ class Camera {
891936
* // Create a p5.Camera object.
892937
* cam = createCamera();
893938
*
939+
* // Set the camera
940+
* setCamera(cam);
941+
*
894942
* // Place the camera at the top-right: (100, -400, 800)
895943
* // Point it at the origin: (0, 0, 0)
896944
* // Set its "up" vector: (0, 1, 0).
@@ -935,6 +983,9 @@ class Camera {
935983
* // Create a p5.Camera object.
936984
* cam = createCamera();
937985
*
986+
* // Set the camera
987+
* setCamera(cam);
988+
*
938989
* // Place the camera at the top-right: (100, -400, 800)
939990
* // Point it at the origin: (0, 0, 0)
940991
* // Set its "up" vector: (0, 1, 0).
@@ -1605,6 +1656,9 @@ class Camera {
16051656
* normalMaterial();
16061657
* // Create a p5.Camera object.
16071658
* cam = createCamera();
1659+
*
1660+
* // Set the camera
1661+
* setCamera(cam);
16081662
* }
16091663
*
16101664
* function draw() {
@@ -1684,6 +1738,9 @@ class Camera {
16841738
* // Create a p5.Camera object.
16851739
* cam = createCamera();
16861740
*
1741+
* // Set the camera
1742+
* setCamera(cam);
1743+
*
16871744
* // Place the camera at the top-center.
16881745
* cam.setPosition(0, -400, 800);
16891746
*
@@ -1746,6 +1803,9 @@ class Camera {
17461803
* // Create a p5.Camera object.
17471804
* cam = createCamera();
17481805
*
1806+
* // Set the camera
1807+
* setCamera(cam);
1808+
*
17491809
* // Place the camera at the top-center.
17501810
* cam.setPosition(0, -400, 800);
17511811
*
@@ -1809,6 +1869,9 @@ class Camera {
18091869
* // Create a p5.Camera object.
18101870
* cam = createCamera();
18111871
*
1872+
* // Set the camera
1873+
* setCamera(cam);
1874+
*
18121875
* // Place the camera at the top-center.
18131876
* cam.setPosition(0, -400, 800);
18141877
*
@@ -3803,6 +3866,9 @@ function camera(p5, fn){
38033866
* // Create a p5.Camera object.
38043867
* cam = createCamera();
38053868
*
3869+
* // Set the camera
3870+
* setCamera(cam);
3871+
*
38063872
* // Place the camera at the top-center.
38073873
* cam.setPosition(0, -400, 800);
38083874
*

0 commit comments

Comments
 (0)