The problem is getting the point that the player is looking at. i solved this by converting the direction the player is looking to radians then using sin and cos to get the point said distance in front of them. Like this:
public static Vector3f getMouseLook(float d) {
float x = Camera.vector.x;
float y = Camera.vector.y+Camera.height;
float z = Camera.vector.z;
//note that the x and y direction are flop flopped due to the way they get rendered
float xdir = (float) ((Camera.rotation.y-90)*Math.PI)/180;
float ydir = (float) (-Camera.rotation.x*Math.PI/180);
float x1 = (float) ((d*Math.cos(xdir)));
float y1 = (float) ((d*Math.sin(ydir)));
float z1 = (float) ((d*Math.sin(xdir)));
return new Vector3f(x1+x,y1+y,z1+z);
}
well for some reason as i start to look up or down (somewhere around 75-80 degrees) the spot will stop going up/down. does anyone know why or have a better method to refer me to?
if you look at some of my newer videos of the game on youtube (http://www.youtube.com/user/gopro2027) you can probably see what i mean