CSS goes 3D with voxel.css

The web is often seen as a decidedly two-dimensional medium. And, to be fair, it is. That’s what it was designed for.

What’s more, the addition of three-dimensional graphics, rendered live, has traditionally required plugins. Macromedia gave us Shockwave, Unity gave us the Unity Web Player, and all the while, we’ve used 3D graphics for games, mostly.

HTML5, CSS3, and some inventive JavaScript have done a lot to change this, however. Oh, it’s still mostly used for games, but you can take it further, and integrate the graphics into a regular site more easily than ever.

Sure, we still have usability concerns. A site that depends on 3D graphics for navigation or essential content is still a terrible idea. However, when used with progressive enhancement, 3D is a viable, and even performance-friendly way to take things up a notch.

To that end, I present voxel.css.

voxel.css is a framework that uses CSS3 to do the heavy lifting of rendering 3D objects. JavaScript is used to add interactivity, trigger the animations, and pretty much everything else.

Style

Well, this is CSS we’re talking about. You’re not going to get Crysis-level graphics. As the name of this framework suggests, what you get is a lot of cubes. Think Minecraft in the browser. (And someone will build a Minecraft clone with this in three… two…)

Still, you can do some impressive things with blocky graphics. Think of it as taking 8-bit art to a whole new level.

Easy 3D rendering

The basic implementation of voxel.css only requires the inclusion of the library, and 15 lines of code. This creates a savable virtual scene where you can edit your models, point-and-click style.

You can then display these scenes to any web page, and animate them as desired.

Use any image type for textures

Use a PNG for transparency, a GIF for animation, or an SVG file for unlimited scalability. Use a JPG for reasons unknown, or the WebP format because you like things that aren’t implemented in all browsers yet.

There’s even a demo that uses live footage from your webcam as textures for the blocks.

GPU acceleration

Again, it’s CSS3. You can use the superior rendering power of a device’s graphics card (or chip, as the case may be) to display your work. You won’t have to worry about choppy graphics on anything but the slowest of mobile devices. (You should be using a fall-back for those in any case.)

Conclusion

voxel.css is a simple, no-nonsense way to get some three-dimensional goodness into your web app, page, site, or game. Try it out, look at the demos, and see if it’s right for your project.

Recommended Articles

The Web Can’t Go Home Again

The Web Can’t Go Home Again

It’s far too easy to look back and imagine that everything was better then than it is now. God knows I miss being a skinny teenager, but I don’t want

About Us

We are a dynamic information platform dedicated to delivering timely, relevant, and reliable content across a broad spectrum of topics. From the latest in technology and business to lifestyle, health, and global affairs, we aim to keep our readers informed and inspired.

Our editorial team is committed to maintaining high standards of accuracy and clarity, ensuring that every article provides value and context in an ever-changing world. We believe in the importance of accessible knowledge and strive to make complex topics understandable for everyone.

Whether you're here to stay updated on current events, explore thought-provoking features, or simply learn something new, our goal is to offer a trustworthy source of information that meets the needs of a diverse and curious audience.