Computer Graphics with p5.js
Computer Graphic algorithm experiments using p5.js.
Algorithms
- DDA Line Drawing
- Bresenham Line Drawing
- Bresenham Circle Drawing
- Midpoint Circle Drawing
- Cohen Sutherland Line Clipping
- Region Filling
- Transformation
Add a new algorithm:
- Create a new file in the
algorithms
folder. - Write a function for the algorithm with
display: Display
as a parameter. - Use
display.setPixel(x, y)
to set a pixel on the canvas. - Call the function in the
draw
function insrc/main.ts
.
How to run
Installed necessary packages:
yarn
To run the development build:
yarn dev
To run the production build:
yarn build
To preview the production build:
yarn preview