Z-Sorted Sprites in 3d

October 6th, 2008

Sprite3D Z-Sorting

On a recent job, I had a need for a 3d scene with lots of sprites. I decided to use Papervision3d but couldn't find an easy way of having an interactive sprite in the scene. There are classes for billboard planes, but that seemed like too much calculation. This means you can do anything you would normally do with a sprite, but in 2.5d.

The solution turned out to be pretty simple. Just use the screen.x, y and z variables in the DisplayObject3D class to align some sprites to their projected 3d locations, and then z-sort the whole lot of them.

  • Works with Papervision3D 2.0 (GreatWhite)
  • The z-sorting for each SpriteGroup3D completely circumvents papervision's internal sorting so this won't work in conjunction with other types of scene objects (like polygons)

Hopefully someone will find them useful =) View the rest of this post for the code.

Read the rest of this entry »

one sf night

July 14th, 2008

Photo and Photoshop, 2007

MeshWalk FrameBuffer

May 26th, 2008

Just posted a couple videos to Flickr. I've been playing with using Frame Buffer Objects in GL as a way to draw dynamically to a surface. I'm pretty happy with the result. Drawing to a 1024 x 1024 texture is very fast. Go GL!

Projection Transform

May 26th, 2008

A few weeks ago Robert Hodgin of flight404 posed a question to the OooShiny group. You've probably already seen the LASER Tag project by Graffiti Research Lab.

So if you want to do something similar in Processing, the first thing you need to do is transform the point on your surface (building, wall, etc) to a point on your texture. After a lot of valiant help from Keith, the math was still confusing me. Then I stumbled on the PerspectiveTransform class. Given 4 points unTransformQuad() will map any value inside to a point on a unit (0 to 1) square. Anyway, I hope this helps someone =)

Read the rest of this entry »

Graphics Gems II

January 8th, 2008

Last night while browsing around looking for a better implementation of Xiaolin Wu's line drawing algorithm, I stumbled on (err.. explicitly searched for) a .pdf copy of the 1994 book Graphics Gems II. I found one here (direct link below). I think this is the wrong book for the line drawing algorithm but there's a ton of other useful stuff inside.

RapidShare .pdf

is it love?

December 7th, 2007

   ///\    ///\
  //  /\  //  /\
 //    /\//    /\
//      /\      /\
//   x      x   //
 //     ..     //
  //   ____   //     xx
   //        //     x..x
    //      //     x.  .x
   //\\    //\\    x.  .x
  //  \\  //  \\      .x
 //    \\//    \\    .x
//\     \/     /\\   .x
      //  \\         xx
   ///\    /\\\      xx


November 26th, 2007

       //\\\          _
     //.\\.\\\       | |
   //\\\\\\\\\\\     | |
   /////////////   _\| |/
    //\\\////    /\\\/\///
       /////      \\\\\///
    ////\\\\\\\    ||\||/
   //////\\\/\\\   ||\||/
  //\/////\/\\\\\  ||\||/
    ///\\  ///\\
    //\\\  //\\\
    ///\\  ///\\
    ///\\  //\\\
  ////\\/  /\/\\\\

copy and paste

Simple Sand

November 20th, 2007

I should have been playing Mario Galaxy last night, but I made this 2d sand thing in actionscript instead. This is the most basic of basic sand rulesets. Only, this time it's in Flash.

Super Simple Sand

The Other LogoDesign

November 6th, 2007

A few months ago I worked on a visualization for Twitter called Blocks. In the last few days I made this logo as a finishing touch but it was taken out of the final app.

Twitter Blocks Logo (alt)

The Blocks