I am further understanding this rotation and camera movement.This time I have added the code for moving the cube along Y-axis.And this is the following code I have added.But what happens is that the camera itself is moving up and the cube disappears.
if(keyA) {
SimpleVector t = cube.getYAxis();
//t.scalarMul(SPEED);
moveRes.add(t);
System.out.println(" keyA x " + moveRes.x+ " keyA y " + moveRes.y + " keyA z " + moveRes.z);
moveRes = cube.checkForCollisionEllipsoid(moveRes, ellipsoid, 8);
System.out.println(" x " + moveRes.x+ " y " + moveRes.y + " z " + moveRes.z);
if(moveRes.y < 0) {
System.out.println(" less than zer0....");
cube.translate(0, 0.25f, 0);
}
else {
cube.translate(moveRes);
}
cube.translateMesh();
cube.clearTranslation();
}
I have added the above two lines. But the cube is not moving along y-axis, similarly the way it is moving along z-axis. Instead of that, the camera itself is moving up as I described earlier.