@@ -46,7 +46,7 @@ slug: learn/
46
46
<h1 >Getting Started with 3D in p5.js</h1 >
47
47
48
48
<p >p5.js is a powerful tool for creating 2D graphics but it's also capable of 3D graphics.
49
- There are some new concepts to learn before moving from 2D to 3D, this document will introduce some ideas
49
+ Before we can get started in 3D there are some new concepts to learn and this document will introduce some ideas
50
50
that will be important to any 3D sketch.</p >
51
51
52
52
<div class =" toc" >
@@ -98,8 +98,8 @@ slug: learn/
98
98
<h2 id =" coordinate_space" >3D Coordinate Space: Positioning in 3D</h2 >
99
99
100
100
<div class =" additionalInformation" >
101
- It might be helpful to revisit the tutorial titled
102
- <a href =" {{ root }} /learn/coordinate-system-and-shapes.html" >Coordinate System in Shapes</a >
101
+ If coordinates systems aren't making sense it might be helpful to revisit the tutorial titled
102
+ <a href =" {{ root }} /learn/coordinate-system-and-shapes.html" >Coordinate System and Shapes</a >
103
103
</div >
104
104
105
105
<p >One of the most fundamental differences between working in 2D and working in 3D is the most obvious: there is
@@ -391,7 +391,7 @@ function draw(){
391
391
size as it gets further away and has no vanishing point. </p >
392
392
393
393
<p >Constantly moving and adjusting the camera in code can be tedious, especially when you are experimenting with
394
- ideas. p5.js has a special camera method, <a class =" code" >orbitControl()</a >, that can be used to zoom, pan,
394
+ ideas. p5.js has a special camera method, <a class =" code" >orbitControl()</a >, that can be used to zoom, pan,
395
395
and position the camera using the mouse.</p >
396
396
397
397
<ul >
@@ -415,17 +415,35 @@ function draw(){
415
415
<p >In p5 we have: </p >
416
416
417
417
<ul >
418
- <li ><a class =" code" href =" {{ root }} /reference/#/p5/ambientLight" >ambientLight()</a ></li >
419
- <li ><a class =" code" href =" {{ root }} /reference/#/p5/directionalLight" >directionalLight()</a ></li >
420
- <li ><a class =" code" href =" {{ root }} /reference/#/p5/pointLight" >pointLight()</a ></li >
421
- <li ><a class =" code" href =" {{ root }} /reference/#/p5/spotLight" >spotLight()</a ></li >
422
- <li ><a class =" code" href =" {{ root }} /reference/#/p5/noLights" >noLights()</a ></li >
418
+ <li ><a class =" code" href =" {{ root }} /reference/#/p5/ambientLight" >ambientLight()</a >
419
+ <ul style =" margin-left:15px;" >
420
+ <li >Ambient light makes everything display a little brighter, with no consideration for light position or
421
+ direction.</li >
422
+ </ul >
423
+ </li >
424
+ <li ><a class =" code" href =" {{ root }} /reference/#/p5/directionalLight" >directionalLight()</a >
425
+ <ul style =" margin-left:15px;" >
426
+ <li >A directional light shines from one direction, which can be especially useful for communicating depth in
427
+ a scene, or when a scene needs a 'sun' light. This method accepts a color and direction.</li >
428
+ </ul >
429
+ </li >
430
+ <li ><a class =" code" href =" {{ root }} /reference/#/p5/pointLight" >pointLight()</a >
431
+ <ul style =" margin-left:15px;" >
432
+ <li >A point light emits from a single point in all directions, similar to something like a lightbulb. This method accepts a color and a position for the light.</li >
433
+ </ul >
434
+ </li >
435
+ <li ><a class =" code" href =" {{ root }} /reference/#/p5/spotLight" >spotLight()</a >
436
+ <ul style =" margin-left:15px;" >
437
+ <li >A spot light emits from a single point in a single direction. This light is cast in a conical shape and it's radius and concentration can be adjusted.</li >
438
+ </ul >
439
+ </li >
440
+ <li ><a class =" code" href =" {{ root }} /reference/#/p5/noLights" >noLights()</a >
441
+ <ul style =" margin-left:15px;" >
442
+ <li >noLights() makes it so that all subsequent geometry is rendered without any lighting. This can be useful when you want flat, unshaded geometry.</li >
443
+ </ul >
444
+ </li >
423
445
</ul >
424
-
425
- <p >Ambient light makes everything display a little brighter, with no consideration for light position or
426
- direction. A directional light on the other hand can be moved and rotated to shine directly on a geometry. The
427
- spot light is similar, but casts light evenly within a cone shape. Finally, noLights can be used to render a
428
- geometry without lighting, which is useful for displaying textures or solid colors. </p >
446
+ <br />
429
447
430
448
{{!-- sketch illustrating lighting of geometry --}}
431
449
<iframe src =" {{ assets }} /learn/basic3D/lightingExample.html" width =" 720" height =" 350" >
@@ -439,31 +457,27 @@ function draw(){
439
457
<p >In p5 we have </p >
440
458
441
459
<ul >
442
-
443
460
<li ><a class =" code" href =" {{ root }} /reference/#/p5/normalMaterial" >normalMaterial()</a ></li >
444
461
<li ><a class =" code" href =" {{ root }} /reference/#/p5/ambientMaterial" >ambientMaterial()</a ></li >
445
462
<li ><a class =" code" href =" {{ root }} /reference/#/p5/emissiveMaterial" >emissiveMaterial()</a ></li >
446
463
<li ><a class =" code" href =" {{ root }} /reference/#/p5/specularMaterial" >specularMaterial()</a ></li >
447
-
448
464
</ul >
449
465
450
- <p >You can even draw to another image and apply it as a texture to the object. </p >
451
-
452
- <p >and more custom materials can be achieved through <a class =" code" >texture()</a > and shaders, which will be
453
- discussed more at length
454
- later. </p >
466
+ <p >More custom materials can be achieved through using <a class =" code" >texture()</a > and shaders. These are a bit
467
+ beyond the scope of this tutorial, so make sure to check out the <a
468
+ href =" {{ root }} /learn/introduction-to-shaders.html" >Introduction to Shaders</a > page when you are ready. </p >
455
469
456
470
{{!-- sketch illustrating materials --}}
457
- <iframe src =" {{ assets }} /learn/basic3D/materialsExample.html" width =" 720" height =" 350" >
458
- </iframe >
471
+ {{!-- <iframe src="{{assets}}/learn/basic3D/materialsExample.html" width="720" height="350">
472
+ </iframe> --}}
459
473
460
474
<h2 id =" glossary" >Glossary</h2 >
461
475
462
- <h3 >World Space</h3 >
476
+ {{!-- <h3>World Space</h3>
463
477
<p>A coordinate space that is relative to the world origin (0,0,0)</p>
464
478
465
479
<h3>Screen Space</h3>
466
- <p >A coordinate space that is relative to the top left of the screen (0,0)</p >
480
+ <p>A coordinate space that is relative to the top left of the screen (0,0)</p> --}}
467
481
468
482
<h3 >Model</h3 >
469
483
<p >A custom 3D geometry that can be saved and loaded from a file</p >
0 commit comments