
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
obelisk-browserify
Advanced tools
Obelisk.js is a JavaScript Engine for building isometric pixel objects.
With the simple and flexible API provided by it, you can easily add isometric pixel element like brick, cube, pyramid onto HTML5 canvas. Obelisk.js strictly follows the pixel neat pattern: lines with 1:2 pixel dot arrangement, leading to an angle of 22.6 degrees.
You should know this is not for vector isometric graphics drawing. In fact it is not using any canvas graphic drawing API at all, instead, it manipulates all the things in pixel level to obtain typical pixel arrangement. Just try it out to pixelate something. Have fun.
Origin:
User Contributed:
Simply include obelisk.js in your project
<script src="//path/to/obelisk.min.js"></script>
In JavaScript
// create a canvas 2D point for pixel view world
var point = new obelisk.Point(200, 200);
// create view instance to nest everything
// canvas could be either DOM or jQuery element
var pixelView = new obelisk.PixelView(canvas, point);
// create cube dimension and color instance
var dimension = new obelisk.CubeDimension(80, 100, 120);
var gray = obelisk.ColorPattern.GRAY;
var color = new obelisk.CubeColor().getByHorizontalColor(gray);
// build cube with dimension and color instance
var cube = new obelisk.Cube(dimension, color, true);
// render cube primitive into view
pixelView.renderObject(cube);
For more details, check the tutorial part 1: To build the first cube or try the code yourself
Also you can use it in your Node.js canvas project
As node.js
canvasdependency can be tricky to install (binary dependency on Cairo) we are not adding it as a project dependency. You will need to add thecanvasdependency explicitly on your project:
$ npm install canvas
$ npm install obelisk.js
In your JavaScript
// load Node Canvas dependency
var Canvas = require('canvas');
// load obelisk.js module
// here we need the Canvas as a module parameter
var obelisk = require('obelisk.js')(Canvas);
// create a Node Canvas instance
var canvas = new Canvas(600,450);
// Use obelisk the same way you will use it in the browser ...
// Save canvas to a file
canvas.createPNGStream().pipe(fs.createWriteStream('./figure.png'));
For more details, check the Node.js Canvas example.
obelisk.js can also be used from a browserify project. Simply:
var obelisk = require('obelisk.js');
console.log(obelisk.Point)
// > function Point() { }
Step by step:
Sample code for building all primitives:
To add more pixel primitives - 4 directions slopes will be the first
See details in the release notes.
Pixel art is a form of digital art, where images are edited and displayed on the pixel level. The isometric projection is commonly seen in games to provide a 3D view without using any real 3D processing.
Obelisk.js is released under the MIT License
FAQs
Browserify-compatible fork of obelisk.js, hopefully temporary
We found that obelisk-browserify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.