help with shadows

i’m trying to implement the shadows volume approach in my application. Lesson 27 of
nehe was my base code. In my scenes i have
a ground, buildings (objects) and a light (sun).
The problem is that the shadows are not
appearing correctly. Look to this image to
make clear my problem.
The green part is the background and that shadow should not appear there.

helps will be very welcome,

You need to cap the shadow volume, and make sure it isn’t clipped at the far plane. Just extrude enough to reach past the building.

Me again,
I tried to make shorters extrusions,
see this sequence:
but (like the pictures show) the problem
shouldn’t the shadows only appear over the ground (base circle)?
maybe the nehe lesson 27 code only works fine
if the scene is indoor.