Go through the libraries here (which are known to have many users, good documentation, and a lot of examples).
Look at the documentation and demos. Get a sense what it is designed for.
Build a landscape, a space, data visualization/space using one of the libraries.
| Library | Good for | Resources (a starting point, not a complete list) |
| three.js | 3D space |
Creating a scene, three.js examples, Three.js Journey, Three.js Resources |
| PixiJS | 2D, WebGL-fast, addressable
sprites |
Quick start, PixiJS examples, Playground, Showcase |
| D3.js | a data landscape, terrain or
cityscape built out of real data (weather, transit, your own data) |
What is D3?, Getting started (see "D3 in vanilla HTML"), D3 gallery |
| A-Frame | 3D space written as HTML tags
(<a-box>, <a-sky>). Built on three.js, the easiest
way into 3D, and it works in VR headsets |
Introduction, A-Frame examples, Showcase |
| Babylon.js | true 3D space, an
alternative to three.js with more built in (physics, GUI) and an online playground |
The very first step, Feature demos, Playground |
| Phaser | 2D game worlds. A full game
framework: scenes, sprites, tilemaps, camera, input and physics are included |
Making
your first Phaser 3 game, Create a
game app, Phaser examples |
| Leaflet | An
interactive map with your own markers, shapes and popups |
Quick start guide, Leaflet tutorials |
| p5.js | creative coding, generative art,
the easiest on-ramp if you are newer to code |
Get started, p5.js examples |
Warning: many libraries need a server.
If you double-click your HTML file, the address bar starts with file://.
A small example with one CDN line usually still works that way. But as soon as a page uses
<script type="module">, or loads images, sounds, 3D models or data files,
the browser blocks it and you get a blank page. three.js and PixiJS projects almost always
hit this.
Fix: open the page through a server so the address starts with http://.
In VS Code, install the Live Server extension, right-click your HTML file,
and choose "Open with Live Server". A page uploaded to a web server also works.
If you see a blank page, check the address bar first, then the console.
Library field notes
Write these while you look through the documentation and demos (spend
10-20 minutes), before you start prompting. Every library has its own
vocabulary: nouns for the things it makes (in three.js:
Scene,
Camera,
Mesh) and verbs
for what you do with them. Look at the "Getting Started" page, the
words after
new in the first example, and the words that
keep repeating across the demos. (Remember, traditionally these
libraries take months to learn so you will not be able to fully
understand the language unless you have prior experience).
## Library field notes
Libraries I looked at:
Why I chose this one:
What it is for: (digested in your own words)
What it is not good for:
Vocabulary (5 to 8 words what you understand to be the vocabulary used):
Start in Plan mode
Before asking Copilot to write any code, make a plan with it first.
- In VS Code, open the Chat view (
⌃⌘I on Mac,
Ctrl+Alt+I on Windows).
- Choose Plan from the agents dropdown at the bottom of the chat (the menu
that usually says "Agent").
- Describe the landscape you want to build. Use the library's vocabulary from your field
notes, and ask for one self-contained
index.html file.
- Plan mode does not change any files. It answers with a step-by-step plan and questions
about anything unclear. Answer the questions and revise the plan until it describes what
you want.
- When the plan looks right, click the button to implement it.
Copy the final plan into your README along with your prompts.
Sample starter Each one has the prompts that were typed, in order, and the page
that came out of them. Read the prompts first, then open the page. (In retrospect,
| Sample | Library | Prompt | Page |
| Clickable, draggable cubes | three.js |
prompt |
html |
| Platformer game | PixiJS |
prompt |
html |
Hand in
Use one library and create a scene. (If you have time/interest/tokens, you can work on another library. Make sure you hand it in as a separate folder).
Hand in your working html/js/css files (you can ask Copilot to generate one self-contained file,
which may be easier), with these two things:
- Comments in the code. Comment inside the code what it does, in
English. You can have AI write this.
- A
README.md file with:
- a Library field notes section (see above)
- the library you used
- the prompts you used
- the % of AI usage remaining when you started, and the % remaining when you finished
Put your landscape and its README in google drive folder
here.
(Next time we do this kind of lab, I'd like
to make possible for other students in the class to test your landscape as a starting point if they choose to do so. Also it gives us a sense what we can do with these different libraries).