projective shadow problem

hi all,

i draw shadows by a simple matrix which needs light position & ground plan equation.

In my first test, all what’s drawn correctly, but when i ported it into my second app (which is most simple than the first one), the shadow is not drawn correctly.

I do something like that:

I have a small area which is the game are, and behind it i have a big rectangle which means the background (think to move my textures on it later…), and onto my game area there are 3 simple things: 2 cubes and 1 sphere. A light is over the whole.

I draw like that:

get modelview matrix
transform point of view
draw the background (1)
get into stencil buffer
draw the area
cast shadows on it with drawing the elements
leave the stencil buffer
(1) - i tryied draw here it
draw the area
draw the elements

But the shadow is not at the good face of the area, and i need the background to see them.
I don’t see what’s happened.

thanx for any help