Ideal Binary Blog 

You will find information on all aspects of our work here on our company blog.

Enter your email to hear about our products.

Making An iPhone App - Prototype

We're currently adding polish to 3D Bookshelf for iPhone and iPod touch before we submit to the App Store. 3D Bookshelf is a 3D eBook reader. From what we can tell, it looks like it's the worlds first proper 3D eBook reader application. Hopefully we'll be in review soon.

menu

As with all our apps, we began with a proof of concept prototype. After Kevin had researched the typography requirements and identified the memory budgets, I began prototyping the 3D book engine. The design we put together required us to have a 3D book model that could be opened and closed to a specific page. The design also required a page-turn animation (left to right and right to left). In addition to this we wanted the book model to be resizable, so that we could change the dimensions of the cover, pages and depth (the number of pages).

~ 3D Bookshelf ~

Robin Hood Edition

Free Download!

3D Bookshelf - Robin Hood Edition uses the world's first fully 3D eBook engine.

Download it for free now!

I started by using Blender to model up some key frames of a book opening and closing along with page-turns. It quickly became obvious that we would need an enormous amount of content if we wanted to be able to reflect the exact page a user was looking at (in 3D) without sacrificing quality. So after 7 hours spent with Blender trying different approaches, I decided instead to write a real-time engine to build the entire book in 3D including page-turns.

This approach offers a number of benefits. First, the code builds the 3D model in real-time so (excluding textures) there is no content requirement except for the parameters for each book. The parameters to the system include the width and height of the book, the number of pages, the current page, how open the book is and some others regarding how the page-turn can happen. Second, since it's real-time we can vary all of these parameters at the same time or individually. For example, we can have a page turning as the book is opening and so on.

There are two constraints that the 3D real-time book engine must enforce to guarantee a coherent simulation.

  1. The width of a page cannot change. It must be constrained to remain consistent during a page-turn. The page width must also be constrained when the book is fully open (regardless of the bend in the page) and it must be constrained when the book is fully closed (which is the easy bit).
  2. The depth of the book (based on the number of pages in the book) must remain constant regardless of how open or closed the book is. Again, when the book is closed this is simple to enforce, but when the book is open and there is a bend in the paper it becomes more complex.

The constraints distill down to a simple quadratic equation which I converted to C# and then further optimized. I initially implemented the prototype with C# using WPF (Java would have worked just as well). I find it much easier to test and optimize mathematical algorithms in C# with unit tests at a high level, and then when I'm satisfied, I port to C++ and possibly make further tweaks. When we were happy, Kevin and I ported the lot to C++.

The 3D book engine prototype took just over 10 hours to write. I'll be releasing a behind the scenes screencast showing the prototype in operation in a follow-on post, so check back soon.

prototype

While I was working on the 3D book engine, Kevin was knee deep in the typography system in addition to getting the 3D book renderer ready. You can find out more about how he got on over at his blog. In my next post I'll talk about taking off my developer hat and putting on my designer hat to produce the graphics for the app, along with the website. Please subscribe to my RSS feed or follow me on twitter for updates.

Welcome to Ideal.Binary.Web!

Welcome to my new home at Ideal Binary. From September 1st, I'll be working full-time on .NET (MVC and Silverlight) and iPhone development.

For the last few months, I've been chipping away at my own blog/CMS written with ASP.NET MVC called Ideal.Binary.Web. There are already several .NET open-source alternatives currently available but there's nothing quite like rolling your own. When it comes to making changes and updates, things become so much easier when you own the architecture.

The site sports all the usual features you world expect from a blog/CMS, including support for Windows Live Writer. I recently added ELMAH exception logging and a full site multi-index search system that sits on top of Lucene.Net.

I have some interesting updates planned and I'll be blogging about these and the site in general over the coming months. I'll also be talking about game development subjects, such as content production, physics engines, and how to write testable cross-platform cpp code.

Stay tuned.