···11+# Zdog
22+33+_Round, flat, designer-friendly pseudo-3D engine_
44+55+View complete documentation and live demos at [zzz.dog](https://zzz.dog).
66+77+## Install
88+99+### Download
1010+1111++ [zdog.pkgd.min.js](https://unpkg.com/zdog@0/dist/zdog.pkgd.min.js) minified, or
1212++ [zdog.pkgd.js](https://unpkg.com/zdog@0/dist/zdog.pkgd.min.js) un-minified
1313+1414+### CDN
1515+1616+Link directly to Zdog JS on [unpkg](https://unpkg.com).
1717+1818+``` html
1919+<script src="https://unpkg.com/zdog@0/dist/zdog.pkgd.min.js"></script>
2020+```
2121+2222+### Package managers
2323+2424+npm: `npm install zdog`
2525+2626+Bower: `bower install zdog`
2727+2828+## Hello world demo
2929+3030+Create 3D models with Zdog by adding shapes. See [Getting started](https://zzz.dog/getting-started) for a walk-through of this demo.
3131+3232+``` js
3333+let isSpinning = true;
3434+3535+const illo = new Zdog.Illustration({
3636+ element: '.zdog-canvas',
3737+ zoom: 4,
3838+ dragRotate: true,
3939+ // stop spinning when drag starts
4040+ onDragStart: function() {
4141+ isSpinning = false;
4242+ },
4343+});
4444+4545+// circle
4646+new Zdog.Ellipse({
4747+ addTo: illo,
4848+ diameter: 20,
4949+ translate: { z: 10 },
5050+ stroke: 5,
5151+ color: '#636',
5252+});
5353+5454+// square
5555+new Zdog.Rect({
5656+ addTo: illo,
5757+ width: 20,
5858+ height: 20,
5959+ translate: { z: -10 },
6060+ stroke: 3,
6161+ color: '#E62',
6262+ fill: true,
6363+});
6464+6565+function animate() {
6666+ illo.rotate.y += isSpinning ? 0.03 : 0;
6767+ illo.updateRenderGraph();
6868+ requestAnimationFrame( animate );
6969+}
7070+animate();
7171+```
7272+7373+## About Zdog
7474+7575+Hi, [Dave here](https://desandro.com). I wanted to make a video game. I needed a 3D engine, but most engines were too powerful and complex for me. I made Zdog so I could design and display simple 3D models without a lot of overhead.
7676+7777+Zdog is directly inspired by [Dogz](https://en.wikipedia.org/wiki/Petz), a virtual pet game by P.F. Magic released in 1995. It used flat 2D circle sprites to render the Dogz’ models, but in a 3D scene. [See Dogz playthrough video here.](https://www.youtube.com/watch?v=6lKSn_cHw5k) Dogz were fully animated in real time, running, flopping, scratching (on Windows 3.1!). It was remarkable.
7878+7979+Zdog uses the same principal. It renders all shapes using the 2D drawing APIs in either `<canvas>` or `<svg>`. Spheres are actually dots. Toruses are actually circles . Capsules are actually thick lines. It’s a simple, but effective trick.
8080+8181+Zdog is pronounced "Zee-dog" in American parlance or "Zed-dog" in British.
8282+8383+### Beta!
8484+8585+Zdog v1 is a beta-release, of sorts. This is my first time creating a 3D engine, so I probably got some stuff wrong. Expect lots of changes for v2. Provide input and select new features on the [Zdog issue tracker on GitHub](https://github.com/metafizzy/zdog/issues).
8686+8787+---
8888+8989+Licensed MIT