All Projects → metafizzy → Zdog

metafizzy / Zdog

Flat, round, designer-friendly pseudo-3D engine for canvas & SVG

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Zdog

Alien.js
Future web pattern
Stars: ✭ 141 (-98.42%)
Mutual labels:  3d, svg, canvas
Taro
A lightweight 3D game engine for the web.
Stars: ✭ 345 (-96.13%)
Mutual labels:  3d, svg, canvas
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (-98.29%)
Mutual labels:  3d, svg, canvas
Zfont
💬 Text plugin for Zdog - works with any .ttf font!
Stars: ✭ 126 (-98.58%)
Mutual labels:  3d, svg, canvas
Three.js
JavaScript 3D Library.
Stars: ✭ 78,237 (+778.67%)
Mutual labels:  3d, svg, canvas
Earthjs
D3 Earth JS
Stars: ✭ 128 (-98.56%)
Mutual labels:  3d, svg, canvas
Layaair discard
This is old LayaAir veriosn writetten by ActionScript 3.0 ,now LayaAir is using TypeScript as the Engine Script,Please use https://github.com/layabox/LayaAir instead.
Stars: ✭ 1,858 (-79.13%)
Mutual labels:  3d, canvas
Canvg
Javascript SVG parser and renderer on Canvas
Stars: ✭ 2,963 (-66.72%)
Mutual labels:  svg, canvas
React Particles Webgl
🔆 A 2D/3D particle library built on React, Three.js and WebGL
Stars: ✭ 330 (-96.29%)
Mutual labels:  3d, canvas
Pts
A library for visualization and creative-coding
Stars: ✭ 4,628 (-48.02%)
Mutual labels:  svg, canvas
Spritejs
A cross platform high-performance graphics system.
Stars: ✭ 4,712 (-47.08%)
Mutual labels:  3d, canvas
Zrender
A lightweight graphic library providing 2d draw for Apache ECharts
Stars: ✭ 5,122 (-42.48%)
Mutual labels:  svg, canvas
Html To Image
✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
Stars: ✭ 595 (-93.32%)
Mutual labels:  svg, canvas
Dynamic effect
平时练习的一些前端动效,基于HTML5,CSS3,Canvas,Svg
Stars: ✭ 264 (-97.04%)
Mutual labels:  3d, canvas
React Force Graph
React component for 2D, 3D, VR and AR force directed graphs
Stars: ✭ 589 (-93.38%)
Mutual labels:  3d, canvas
Svg 3d Builder
an elaborate tool to create 3d model with svg
Stars: ✭ 803 (-90.98%)
Mutual labels:  3d, svg
Canvas Test
🎮 happy canvas
Stars: ✭ 1,722 (-80.66%)
Mutual labels:  3d, canvas
Deep Viz
A React component library, providing concise and beautiful diversity charts with Canvas, SVG, E-map, WebGL, Dom, based on data visualization experience and commercial data display practice.
Stars: ✭ 55 (-99.38%)
Mutual labels:  svg, canvas
People You Should Follow On Codepen
People You Should Follow on CodePen
Stars: ✭ 542 (-93.91%)
Mutual labels:  svg, canvas
Curtainsjs
curtains.js is a lightweight vanilla WebGL javascript library that turns HTML DOM elements into interactive textured planes.
Stars: ✭ 1,039 (-88.33%)
Mutual labels:  3d, canvas

Zdog

Round, flat, designer-friendly pseudo-3D engine

View complete documentation and live demos at zzz.dog.

Install

Download

CDN

Link directly to Zdog JS on unpkg.

<script src="https://unpkg.com/zdog@1/dist/zdog.dist.min.js"></script>

Package managers

npm: npm install zdog

Bower: bower install zdog

Hello world demo

Create 3D models with Zdog by adding shapes. See Getting started for a walk-through of this demo.

let isSpinning = true;

let illo = new Zdog.Illustration({
  element: '.zdog-canvas',
  zoom: 4,
  dragRotate: true,
  // stop spinning when drag starts
  onDragStart: function() {
    isSpinning = false;
  },
});

// circle
new Zdog.Ellipse({
  addTo: illo,
  diameter: 20,
  translate: { z: 10 },
  stroke: 5,
  color: '#636',
});

// square
new Zdog.Rect({
  addTo: illo,
  width: 20,
  height: 20,
  translate: { z: -10 },
  stroke: 3,
  color: '#E62',
  fill: true,
});

function animate() {
  illo.rotate.y += isSpinning ? 0.03 : 0;
  illo.updateRenderGraph();
  requestAnimationFrame( animate );
}
animate();

About Zdog

Hi, Dave here. 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.

Zdog is directly inspired by Dogz, 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. Dogz were fully animated in real time, running, flopping, scratching (on Windows 3.1!). It was remarkable.

Zdog uses the same principle. 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. The underlying 3D math comes from Rotating 3D Shapes by Peter Collingridge.

Zdog is pronounced "Zee-dog" in American parlance or "Zed-dog" in British.

Beta!

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.

More Zdog resources

Other people's stuff:

My stuff:


Licensed MIT. Made by Metafizzy 🌈🐻

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].