enne87
04-03-2009, 02:22 PM
Hi guys!
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: A*Px + B*Py + C*Pz + D = 0
A=Nx, B=Ny, C=Nz, D=-(A*Px+B*Py+C*Pz), so for the first plane A = 0, B = 0 , C = 1 and D = 3, right?
Cheers, enne
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: A*Px + B*Py + C*Pz + D = 0
A=Nx, B=Ny, C=Nz, D=-(A*Px+B*Py+C*Pz), so for the first plane A = 0, B = 0 , C = 1 and D = 3, right?
Cheers, enne