Interest in using MathBox in MathBook XML

42 views
Skip to first unread message

Alex Jordan

unread,
Jul 15, 2016, 7:35:31 PM7/15/16
to MathBox
I first saw MathBox when Steven presented it at a WeBWorK code camp in Vancouver BC in 2013. Coincidentally, while attending that same code camp I learned about MathBook XML, and I have been involved with that project in recent years. MathBook XML allows you to write a textbook in XML source. And then it creates synchronized print, HTML, and EPUB output.

I'd like to explore the possibility of using MathBox in a MathBook XML document. I have two immediate questions.
  • Is there a reasonably easy way to make static images from something built in MathBox? For example a .png that captures the initial state of the MathBox image? We would need this for synchronizing interactive images in HTML with static versions in print and EPUB. And we'd need to do it in batches.
  • Is MathBox taxing on client processors? If an HTML textbook had a page with say 10 MathBox images, would the javascript processing be intense? For the most immediate project I am considering, all the graphs would be 3D images like in a calculus textbook. For starters, I'm just considering plots that you could rotate, not images that animate over time.
Thank you to any and all int he forum who can offer me information.

Steven Wittens

unread,
Jul 16, 2016, 8:04:41 AM7/16/16
to MathBox
- You can capture a webgl canvas in a browser using the canvas.toDataURL() method. Doing this server-side and in batch is tricky. Some people have had some success in compiling Chromium with a Mesa based software renderer for example, but as MathBox is GPU-driven, it is tricky to get all the pieces together.

- In the default set up and bootstrapper, MathBox re-renders everything every frame. At the very least you'll want to pause any mathboxen that are scrolled offscreen. If you want to only re-render when the camera has rotated, this is something you have to implement yourself.

Reply all
Reply to author
Forward
0 new messages