Friday, March 07, 2008

Live 3D Graphics With Excel

Every time I get a chance to watch one of our finance folks over at MobiTV wield a spreadsheet, I learn some new tricks. Those financial analysis folks steeped in the arcane features of Excel seem to be able to make the software package produce ever more astounding and useful models of increasingly complex systems.

But this one takes the cake. Check out this really cool implementation of a 3D graphics rendering engine. IN EXCEL! Peter Rakos over at Gamasutra outdid himself.


This image and video pair shows the rendering system using a simple display that colors the native Excel spreadsheet cells as the calculations are being performed.





This image and video pair shows the same program using the Microsoft Office Graphics Abstraction Layer to do the rendering instead of using writes to the spreadsheet cell.




Even better, some of the spatial layout and cell computation models of spreadsheets turn out to be very useful in designing and presenting very compact and elegant representations of the rendering pipeline. This design and layout in the 2-D spreadsheet grid is massively easier to see and understand than all the simple linear text files that I coded up in my college graphics course. It also makes the interrelationships and cell/function dependencies immediately obvious, and debugging is trivial with live previews of the calculations while the program is running. High cool.



"The yellow color marks the user-defined parameters and green color indicates the engine-calculated values. Numbered areas contain the following data:

  1. Parameters of the perspective projection
  2. 3D coordinates of the objects' points (relative to their center)
  3. Shift and rotation matrix (further details can be found e.g. at http://en.wikipedia.org/wiki/3D_projection)
  4. Parameters of the rotation
  5. 3D absolute coordinates of the points after the shift and rotation
  6. 2D coordinates of the points after the perspective projection
  7. Screen coordinates of the points
  8. End points of the objects' edges
  9. Formula of an element in the shift and rotation matrix. Simplicity and compactness are clearly visible."



    Now I don't think anyone currently expects this to evolve into a real 3D simulation system, but it does point to some very interesting 2D layout programming paradigms that might very well turn out to be VERY useful in developing more complex software. It wouldn't surprise me if the professional code development environments evolve towards this sort of thing within the next few years. And of course, 3D environments are just a step away.

    And I have a whole new animation tool for my next presentation!

    Check out the whole post here.

    No comments: