Skip to content

Latest commit

 

History

History

twopoint5d


a library to create 2.5d realtime graphics and pixelart with three.js


npm (scoped)

please see ../README for a general description of this project.


The core features can be roughly classified into the following areas:

  • create and render textured 2D sprites in 3D space
  • load and create sprites from texture atlases or sprite sheet images
  • support frame based animations
  • render as billboards
  • ✔️🚀 ready to use but the api is still in progress
  • load texture atlases from json
  • create tilesets from images
  • ✔️ api is stable and ready to use

three.js offers standardized geometry properties like position, normal, colors, etc.. For rendering, triangles are almost always used as primtives.

The vertex-objects api simplifies the creation of geometries with custom properties. A vertex-object description is used to describe the geometry and its primitives, and an object-based api is used to manage the primitives → vertex-objects → custom sprites of the geometry.

For such a geometry, however, own vertex and fragment shaders are almost always needed, since the standard shaders from the three.js library are of course not written for non-standard geometry properties.

The main motivation behind the vertex objects is to make it easier to create custom geometries, especially instanced geometries (multiple objects within one buffer geometry) without worrying too much about low-level three.js/WebGL details.

This library provides you with a declarative interface to describe the shape of the geometry, incl. indices and attributes and manages the internal attribute buffers, deals with mapping of attributes to buffers AND the update of them.

It should significantly cut down on the amount of boilerplate code and state management you need to do in your applications. At the same time, the vertex objects api gives you a convenient object-based interface to write extremely clean and readable programs for your custom geometries.

  • provides an object based abstraction over instanced buffer geometries. build them with your own api
  • create, update and delete instances with ease
  • legacy api docs: docs/VertexObjects-legacy
  • ✔️ api is stable and ready to use
  • create responsive three.js scenes by describing a projection
  • supports orthogonal and parallax (aka perspective) projections (more to come)
  • api docs: docs/Stage2D
  • ✔️ api is stable and ready to use
  • cosy boilerplate for creating a three.js <canvas> element and dealing with the init, resize and frame event‑loop
  • nice starting point for your three.js demos
  • there is no other dependency than the three.js package itself
  • api docs: docs/Display
  • ✔️ api is stable and ready to use

have fun! :rocket: