I'm trying to use the separating axis theorem to determine if two cubes have collided in a game. But I'm having a problem projecting the vertices of a box onto an axis. It is really hard for me to explain the problem in words so here is a picture:

http://www.host-a.net/u/1101/Squarepicture.bmp
In the picture there are two red squares. The vertices of each square are indicated by the blue dots. The green line running through each of the squares is the axis I want to project the points of the vertices onto. The left square shows how I'm currently projecting the points, by simply taking the dot product of each point with the normalized green axis. However for various reasons this type of projection results in errors when detecting collisions (the game thinks the boxes have collided when they very clearly haven't). The square on the right shows how I would like to project the points of the square (that is sorta along the axis of its normal). Keep in mind that though this picture is in 2D I'm actually working in 3D. So does anyone know how to project the points in this way? (Even knowing the name of this type of projection would be extremely useful since I'd be able to look it up then).