Introduced Zdog 1.0, a pseudo-3D engine for the Web using Canvas and SVG

JavaScript Library Release Available Zdog 1.0, which implements a 3D engine that simulates three-dimensional objects based on vector primitives Canvas and SVG, i.e. realizing a three-dimensional geometric space with the actual rendering of flat shapes. Project Code open under the MIT license. The library has only 2100 lines of code and occupies 28 KB without minification, but at the same time it allows you to create quite spectacular objects that are close in nature to the results of the work of illustrators.

The goal of the project is to provide tools that make working with 3D objects as easy as working with vector illustrations. The engine is inspired by an old computer game. dogz, in which flat 3D shapes based on sprite graphics were used to form a XNUMXD environment.

Introduced Zdog 1.0, a pseudo-3D engine for the Web using Canvas and SVG

3D object models in Zdog are formed using a simple declarative API and are assembled through snapping and grouping simple forms, such as rectangles, circles, triangles, lines, arcs, polygons, and curves. Zdog uses rounded shapes, without pronounced polygonal irregularities. Simple shapes are rendered into more complex XNUMXD representations such as spheres, cylinders, and cubes. At the same time, from the point of view of the developer, spheres are defined as points, tori as circles, and capsules as thick lines.

Composite elements of objects are processed taking into account their relative positions and fastening with invisible anchors. All dynamic properties, such as transformations, rotations, and scalings, are vector operations that are specified using the Vector object. Polygon meshes are supported for features.

Source: opennet.ru

Add a comment