https://github.com/pirtleshell/graphics
playing around with some web graphics
https://github.com/pirtleshell/graphics
Last synced: over 1 year ago
JSON representation
playing around with some web graphics
- Host: GitHub
- URL: https://github.com/pirtleshell/graphics
- Owner: pirtleshell
- License: mit
- Created: 2019-05-11T01:49:40.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-09T03:32:56.000Z (over 5 years ago)
- Last Synced: 2025-02-04T16:49:49.688Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://robert.pirtle.xyz/graphics-demo/
- Size: 729 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# graphics

See a live demo [here](https://robert.pirtle.xyz/graphics-demo/).
I made this mostly just to play with 3D graphics math. Why? Because this is the most hands-on linear algebra can be! A [custom webpack loader](polyLoader.js) loads [files of vertices and faces](src/data) then renders the polygons in 3D space.
It is all rendered in real time _on your CPU_! There's a branch I started on that uses fancy webGL shaders to render on your GPU, but I stopped work on it. Maybe someday?
I implemented a rudimentary light model to shade the polygons. It only draws polygons you can see (thanks normal vectors and dot products) and uses z-index sorting to draw them in the correct order.
The concepts (along with the stegosaurus polygons) were things I learned in a C++ advanced graphics course I took in college.
# license
[MIT](https://choosealicense.com/licenses/mit/) © 2020 Robert Pirtle