I am trying to implement simple projection shaodows, where a second node of an object is set with a projection matrix, so all vertices are flattened to the ground. I have my code working in Xith3d where I simply calculate the projection matrix and set the transformation matrix to it. In jME, the actual rotation is kept in quaternion and when I try to set projection rotation matrix, I get into the problem. The problem is, the actual transformation set is different and I do not get the image flattened.
Here is the code that shows I can't send arbitrary rot matrix:
com.jme.math.Matrix3f mProj=new com.jme.math.Matrix3f(1,0,0,0,0,0,0,0,1);
System.out.println("try to set rotation matrix: "+mProj);
sNode.setLocalRotation(mProj);
System.out.println("the actual rot matrix is: "+sNode.getLocalRotation().toRotationMatrix());
Here is the print out:
try to set rotation matrix: com.jme.math.Matrix3f
[
1.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 1.0
]
the actual rot matrix is: com.jme.math.Matrix3f
[
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
]
I tried the shadows using ocluders but the frame rate drops many times and is not acceptable. Do I have any options for simple shadows on flat plane that performs well?
Stefan