Zdog is a pseudo-3D engine for canvas & SVG.
Zdog helps you design as well as render 3D models. It makes 3D as well as flat shapes.
If you need some quick shapes like circles and rectangles, even in 3D, use this Zdog.
Not just rectangle and circles, but curves, polygon, arc, hemisphere, cone and many more.
Here’s their shapes guide.
Checkout their github repo.
A simplest way to link Zdog to your HTML is just add this script:
Flat Circle Shape
If you want to add a flat circle, you can add this JavaScript:
// create illo
let illo = new Zdog.Illustration({
// set canvas with selector
element: '.zdog-canvas',
});
// add circle
new Zdog.Ellipse({
addTo: illo,
diameter: 80,
stroke: 20,
color: '#636',
});
// update & render
illo.updateRenderGraph();
They have a pretty good getting started guide.
You can get as complex as you want.
3D demo
Here’s a quick demo with shapes in 3D:
3d canvas design examples github library repo SVG zdog