Create a gist now

Instantly share code, notes, and snippets.

pitch/yaw to directional vector
// pitch and yaw are in degrees
Vector3D getDirectionVector() {
return new Vector3D(-Math.cos(pitch * Math.PI / 180.0) * Math.sin(yaw * Math.PI / 180.0), Math.sin(pitch * Math.PI / 180.0), -Math.cos(pitch * Math.PI / 180.0) * Math.cos(yaw * Math.PI / 180.0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment