Bringing the Web to Life with CSS 3D Transforms
comment 0

Bringing the Web to Life with CSS 3D Transforms

CSS 3D uses the transform property to rotate, scale, move and skew an element to give it a three-dimensional effect. In the past, Flash and WebGL were commonly used as solutions for creating 3D models on websites but that has since changed. CSS 3D has been gaining momentum over the past few years but hasn’t seen much implementation on websites. This is probably because it is non-essential for what a website needs to offer. However, this doesn’t mean 3D using CSS is bad, but rather its potential hasn’t been fully realized.

Solid examples

Transforming elements into 3D can create very unique visual effects for the user to enjoy while also immersing the user. Using just HTML/CSS and a little bit of JavaScript, you can even create games that run on modern web browsers. Keith Clark created a demo of how to achieve something close to a game. If you’re not into the whole first-person perspective, Michael Bromley has a space flight demo which is a simple but playable game.

A 3D room created with HTML, CSS and JS. CSS 3D at it's best.

A 3D room created with HTML, CSS and JS.

Learning curve

Dabbling in web 3D may seem like a big learning hurdle. But there are plenty of guides that can be Googled to get started. Personally, I have found this introduction to CSS 3D transforms by David DeSandro to be of great use. While it is a wordy guide, it explains the understanding needed for topic. His git also has a examples of how these transitions will look like.

carousel-example

An example of a 3D carousel. Great base interface for a menu.

Instant 3D

For those who just want to get their hands on web 3D development without learning too much, I have just the tool for you. Tridiv is a site that offers a 3D builder interface that translates whatever you have built on it into HTML and CSS which you can copy and paste into your project. If you are familiar with other 3D modelling programs then you should feel right at home. Note that the tools are simple, but you can create really complex designs like an iPhone for example, or how about an X-Wing?

Interface with X-Wing

An example of how the interface looks like. The model shown is an X-Wing.

Lack of 3D on the web

Many websites are still not implementing 3D using CSS mainly due to these limitations. It only works only on modern web browsers, minimalist web design is a current trend, and not all front-end developers are comfortable working with 3D.

Websites that do have 3D effects are still using Flash but will soon come to a stop as more browsers drop the support for it. Apple took the first step in this and now Google has followed suit, it won’t be long for other web browsers to take similar actions. When that happens, CSS 3D will probably rise in popularity.

We hope you have enjoyed this post as we have writing it. Ever built anything cool in 3D using HTML/CSS/JS? Let us know in the comments down below. Drop a link there and we’ll check it out!

Leave a Reply