Category Archives: Computer Science

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
  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.

    1 Comment

    Filed under Computer Science, Graphics

    A Mechanical Marble Computer

    Matthias Wandel has developed a fantastic mechanical binary adding machine using a simple series of cascaded chutes to store numbers and perform carries through mechanical toggles. Don’t miss the video embedded below to see it in operations.

    Marble Adder


    More details can be found on his web site: along with all manner of interesting contraptions.

    1 Comment

    Filed under Computer Science, Technology, Toys

    Teach Kids to Program

    Last weekend, my wife and I took the kids to the Maker Faire, where I ran into some folks from MIT’s Lifelong Kindergarten group. I would have to say that of the whole Maker contingent, they were showing the most refined educational tools of the bunch, kits and software to teach young children how to program.

    The Scratch programming environment (download Scratch for free here) was designed to eliminate the requirement that a programmer understand code syntax and grammar before being able to do anything useful. The main tool here was to devise a simplified language encapsulated in graphical blocks with shapes that only fit together properly when slotted in the right order and positions.

    The software package includes mechanisms for a host of graphically interesting drawing, sprite control, and audio effects, as well as a built-in mechanism for code sharing and community building. Don’t miss the project pages to check out all the cool code a host of kids have already written.

    moving animation carddance twist scratch card

    One thing that I particularly about the Scratch system is that they have included a physical interface component called the Scratch Board, that allows children’s programs to interact with the real world with sensor blocks, buttons, sliders and so on, each paired with a programming element in the software. Now they can learn to write code, and connect it to the real world!

    You can check out a nice intro Scratch video here:

    Another project on display from the Playful Invention Company [PICO] which grew out of the same group at MIT was called the Pico Cricket. The cricket kit is basically an extension and refinement of Scratch that includes smart blocks designed to interlock with Legos.

    A lot of thought and work has gone into making the programming element even more clear, and the external components more bulletproof, dare I even say kid-proof. For example, each block that houses a sensor or processor or motor has a chip in it which identifies itself and automatically configures the use of interconnecting wires, so you don’t have to worry about how any system is wired together, you just connect them with wires that are all identical in the same way.

    pico cricketmotor and motor board

    displaysound box

    touch sensorlight sensor

    resistance sensor

    Order your Pico Cricket kits here.

    For more developed students in higher grades, don’t miss Hackety-Hack, a cleaned-up (free) version of Ruby/smalltalk with a very nice community and instructional environment packaged around it. This is for the kids who outgrow the limitations of Scratch and are up for the rigors of typing the syntax themselves.

    The amazing thing about this system is the thought that went into incorporating a fantastic Internet, web, and graphics library that is very powerful. As an example, you can implement an entire blog with in six lines of code:

    blog = Table("MyBlog").recent(10) {
    blog.each do |entry|
    title entry[:title]
    puts entry[:editbox]

    This testimonial from the web site says it all:

    Our 8th grader reporting in: did Lesson Four in about 10 minutes but kept hacking for another 20 minutes. Today, video games lost the battle with Ruby. Unprecedented!
    — Brian D

    In researching the effectiveness of these tools, I came across a fantastic blog documenting both the opportunities and potential pitfalls surrounding the use of all these new technology tools to teach 5th grade integrated technology classes. Check out how ENGAGED and excited SOME of these kids are to be creating their own widgets and discovering things on their own! Others seem stuck without the proper guidance. (mostly stuck on the programming parts.)

    I was also led, inevitably to the Playfull Inventing & Exploring effort [PIE]. From their site:

    PIE (Playful Invention and Exploration) is an approach to using new technologies that integrates art, science, music, and engineering. The main goal of PIE is to enable and inspire more people to create, invent, and explore — using a combination of traditional craft materials and new digital technologies.

    PIE projects and workshops make use of Crickets, small programmable devices you can use to create your own musical sculptures, interactive jewelry, communicating creatures, and other playful inventions. The PIE approach was developed through a collaboration of six museums with MIT Media Lab, with support from the National Science Foundation. (For background on the project, see the PIE Network grant proposal.)

    I couldn’t have said it better myself.

    Leave a comment

    Filed under Computer Science, Education

    The Steady March of Progress

    From TechEBlog, check out this 5 MegaByte hard disk from 1956.

    Leave a comment

    Filed under Computer Science

    A Snowflake Closeup

    I first found this image on Chet Ramo’s Science Musings blog, and just stopped to look at it for a while. (click on the image to view a high resolution version.)

    At first glance, it doesn’t really look like a snowflake. In actuality, it is an image of several snowflakes of differing conformation (I counted about eight different varieties) that have been sputter coated with platinum at a very low temperature (in order to make them conductive) and then imaged with a Scanning Electron Microscope equipped with a low temperature stage. The resulting gray-scale image formed by the electron beam was then digitally colored just as the old black and white movies have been “colorized” to result in the above “false color” image. Here’s a picture of the specific unit that was used to take this image.

    Hitachi S-4100 field emission Scanning Electron Microscope

    Check out more details on the equipment here, and the original source of the snowflake crystals images here, and here.


    Filed under Computer Science, Graphics, Technology

    Electro-magnetic Propulsion

    For those of you that dream of one day owning your very own X-34 Land Speeder, the Force is indeed with you, for there is new hope that such a levitating craft might actually be possible.

    There is an interesting article in the September issue of New Scientist that describes a new type of not-quite-rocket engine that uses a novel closed microwave resonant cavity with a geometry that exploits relativistic frames of reference to generate thrust without actually expelling anything.

    At first blush, the idea would seem to violate what we know about Newton’s laws and the “equal and opposite reactions” that have historically driven traditional rocket engines. But according to this theoretical paper by Roger Sawyer, Einstein’s rules of relativity can be exploited to generate thrust without a traditional propellant. The general idea is that the momentum transfers calculations between the trapped resonating microwaves must be done in the photons’ frame of reference. When you work out the math around the truncated cone cavity shape, you end up with thrust in the cavity’s frame of reference despite the fact that nothing is emerging from the cavity.

    European scientists are generally skeptical, but the initial laboratory tests have demonstrated greater thrusts than the recently launched ESA Smart satellite’s ion drive. Better yet, the so-called EM drive reached this performance level without requiring any fuel other than electricity to power a magnetron (a source of microwaves, common to any microwave oven), and all that from an engine that weighs about one tenth of even the very latest ion-engine alternative plus propellant payload.

    Indeed, it sounds too good to be true, but NASA is taking a serious look. Here is a diagram from the article:

    //” cannot be displayed, because it contains errors.

    While a great deal of work would certainly remain in order to improve the new engine efficiency and output to levels useful on Earth, the prospect of having electronically controllable thrust without any emitted blast or heat is an awesome prospect that could change the face of transportation overnight.

    If feasible, I would expect the principle challenges to be in managing high energy densities inside a resonant cavity without expansion, warping, slagging, or other mechanical failures that would ruin the Q (or peak resonance and energy storage capability) of the cavity.

    Definitely worth a look.

    Leave a comment

    Filed under Computer Science, Technology

    Biomimetic Digital Photography

    Or, How to Make Your Camera Work More Like Your Eyes

    Anyone who has ever tried to snap a few photos with a modern camera has probably felt the frustration that the camera often fails to get the exposure quite right, with things that you can see clearly either washed out and over-exposed, or invisible in the shadows. The intrepid among you may have even gone so far as to turn the switch to manual, only to discover that it is really hard to do too much better than the automatic system. You end up with these types of exposure-bracketed images:

    The sky detail is only visible in the lower exposure (faster shutter speed) and the building detail is only visible in the higher exposure. And yet when you look directly at the scene, everything is clearly visible to the naked eye. The reason for this is that through an amazing combination of the iris’ aperture dilation, and the logarithmic response of the photo-receptive neurons in retina, the human eye automatically adapts to an incredibly broad range of illumination intensity as it scans across broad scenes. A camera, on the other hand, must use the same exposure aperture and sensitivity settings across the entire image, and the photo-detectors have a linear response curve.

    As a result, a camera’s dynamic range (the number of discrete brightness gradations it can detect) is much more limited, and the same range is applied across the entire field-of-view. This means that in scenes with wide illumination variations, typical photographs fail to capture details on either the bright side, or the dark side.

    But there is a growing field of photography called “High Dynamic-Range Imaging” that combines multiple photos of varying exposure to artificially expand the dynamic range of a final composite image. The technique has demonstrated amazing results. Here is the final photo created using the three exposures above. (examples from this site)

    Here are some other before and after sets that demonstrate the power of this technique.

    This photo shows a great solution to the canonical problem of imaging a bright outdoors from inside a much darker room. Here is an example applied to portraiture:

    There is definitely an art to assembling the images, because if the technique is applied to aggressively, the resulting images look a little surreal. Here are some more examples from a great web site that are on the edge, but still very interesting.

    And of course, these same techniques are critical to processing photos of astronomical objects. All you need are a few photos and some photo editing software like Photoshop or Paint Shop Pro. And with the great proliferation of interest in these techniques, there is already a large community of web sites hawking the latest techniques and even automated Photoshop plug-in software. Here are a few of my favorites:
    Modern HDR Photography

    Go forth and process.

    Leave a comment

    Filed under Astronomy, Computer Science, Graphics, Photography