Fast and flashy: Famo.us JavaScript framework revealed

Famo.us's product to bring complex 3D graphics, realistic motion to stock Web browsers and ordinary Web developers

Page 2 of 2

Follow the bouncing app

Right now, however, the Famo.us physics engine may be the most interesting. The idea here is to take the kinds of physics that are usually associated with high-end videogames and allow programmers to apply them to objects on a Web page -- without needing to know the nitty-gritty of those engines. This could be something as simple as an overscroll bounce, for instance, or something a good deal more complex.

One demo, called "One to Many," shows a grid made of squares that are viewable from multiple angles. Click on it, and the squares arrange themselves into a stack -- again, viewable from multiple angles. The physics engine allows the programmer to specify such parameters as different, preprogrammed easing functions for the transitions, so many polished-looking effects that used to require lots of hand-coding can now be done out of the box.

Another Famo.us demo shows how the physics engine can be used to create responsive designs for applications. The demo involved a sphere made out of other spheres, with each sphere using a repulsion property to allow them all to maintain an equal distance from each other, even after adding more spheres. In the same way, elements on a Web page can be assigned physical properties. As Famo.us's folks put it, this is that well-worn Web buzzword "responsive design" taken to the next level.

Yet another demo, an image gallery, makes it more clear how Famo.us works with the existing browser object model in a useful way. When I clicked on any of the images to zoom in on them, I was also able to right-click the image and open it in a new browser tab -- just as I would if the image had been displayed on a conventional Web page. Text showed up as regular text, too. A final demo involves a simple incarnation of a Twitter reader app with an infinite scroll view and a smooth-sliding display.

Working in the real world

Famo.us is intended to be cross-browser, so I tried it in every browser I could get my hands on -- with mixed results. Chrome and Safari yielded the best results. The 3D objects themselves rendered fine in Firefox, but the object controls didn't always work. On both my iPad Mini and my Android smartphone, the images were still smooth and flowing, if slightly less impressive on the smaller screens.

One possible downside for developers on a tight bandwidth budget is the size of the Famo.us framework. The entire core JavaScript library takes some 355K or so, but Steve Newcomb, the CEO and founder of Famo.us, says it can be smaller. "We use require.js, which lets a developer only include the parts of Famo.us they need, which means you can deploy significantly smaller footprints."

A new power tool

An easy criticism of Famo.us is that 3D on the Web is nothing new, but Fetterman argues that the larger point of Famo.us is not to reinvent the wheel. "We're not inventing 3D on the Web, nor are we inventing WebGL. Famo.us is just an integration of a lot of these technologies to make it easy for someone to build this stuff. It's hard to achieve the sort of level of sophistication and performance you see in a native iOS, Objective-C app by way of a Web technology."

The strategy, as he put it, is to "build beautiful things," get as many people as possible using them, "then have everyone else catch up -- which is better than having us boil ourselves down to the least common denominator."

The framework, along with a pack of templates to get people up and running with it quickly, is being released as an open source project under the Mozilla Public License Version 2.0. Famo.us is planning to make money from its work by offering a cloud-hosted analytics system, which app developers can hook into if they so choose -- it's not mandatory.

"When you build something in JavaScript," Fetterman says, "you make it by necessity open source and sharable and reusable. I'm excited that nothing is going to get in the way of our core goodness as a platform. ... What we're able to do at the core of Famo.us is build a really a screaming-fast rendering engine in JavaScript, apply a physics engine to that, and apply some bells and whistles and refined principles that mean you can build beautiful things using Web technology across a multitude of devices. Putting things in the way of that makes me unhappy," he says.

This story, "Fast and flashy: Famo.us JavaScript framework revealed," was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

| 1 2 Page 2
From CIO: 8 Free Online Courses to Grow Your Tech Skills
View Comments
Join the discussion
Be the first to comment on this article. Our Commenting Policies