This week my students have to submit their first deliverable for the Mozilla Open Source class at Seneca. I try to practice what I preach, so today I sat down and tried something something similar in size to what they are doing.
The other day I had had an idea that I couldn’t shake: wouldn’t it be cool if you could use shaders and nice WebGL transitions to display slides on the web? We already have all that code written in CubicVR.js (the 3D graphics engine we use for all our demos), so it’s just a matter of teaching CubicVR.js how to use a rendered PDF as a texture. And since Mozilla’s pdf.js project knows how to do the PDF rendering, I just need to do some plumbing to make the two work together.
So this afternoon I wrote a patch for CubicVR.js that added CubicVR.PDF and CubicVR.PdfTexture. This allows me to do really simple code like this small demo. Now I need to get Bobby and CJ to turn it into something really mind blowing
The pdf.js project has really come a long way since I last looked at it, and working with their code was a pleasure. Three cheers for being able to do the impossible in the browser!
UPDATE: It didn’t take CJ long to make this into something awesome. Check out his coverflow-style viewer.


4 Comments
Sadly it doesn’t work when firebug is enabled on the site. Looks like spy.js freaks out.
Awesome though. To think that’s JS.
I’m seeing only a white page for both demos in FF 7. Does it require nightly?
Caspy7: Both demos work for me in Firefox 7 (though I had to give it maybe 10-20 seconds to load the first time, presumably because it was loading the PDF or something). You might be hitting a gfx card/driver issue — do other WebGL demos work for you, e.g. http://bodybrowser.googlelabs.com/body.html ?
Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20100101 Firefox/7.0
David / CJ: This is wicked awesome.
This is incredible, great job!
2 Trackbacks
[...] Griffiths WebGL support for rendering a PDF on a cube, because cubes are awesome, using CubicVR.js and [...]
[...] some new CubicVR stuff: a collection of cool examples and demos and a WebGL PDF viewer using David Humphrey’s PDF texture generation CubicVR module (drag the pages around to turn/pan them, mouse wheel to [...]