I’d like to throw a shadow of a teacup.
I’ve implemented three methods: drawPlanes(), setShadowMat() and display().
drawPlanes() draws two planes: One parallel to the xy-plane and one parallel to the xz-plane respectively.
First plane (xy) is:
Gl.glVertex3f(-20.0f, -20.0f, -3.0f);
Gl.glVertex3f(20.0f, -20.0f, -3.0f);
Gl.glVertex3f(20.0f, 20.0f, -3.0f);
Gl.glVertex3f(-20.0f, 20.0f, -3.0f);
Consequently, the normalvector for the xy-plane is [0,0,1] and xz [0,1,0].
Now I’d like to create the plane equation: APx + BPy + CPz + D = 0
A=Nx, B=Ny, C=Nz, D=-(APx+BPy+CPz), so for the first plane A = 0, B = 0 , C = 1 and D = 3, right?