Lol! Sorry
I didnt know there was 2 pages on this post and read only your reply on the first
Ill try to use your code now Thanks
That is awsome It actually works!!
But theres one problem⦠The viewport doesnt make any sence.
I add a 1x1x1 square. then I set the local translation to 1,0,3
Then the red square covers half of my screen nomather what I do. Good!
But if I set the local translation to 1,0,3.00000001f
Then the square is not visible at all! The screen has no red on it at all!
How can such small thing change it all?
The problem with this is that I cant find where to place my gun as it is never in view. Thats why I tried to find whats infront of the new cam using this square. But having this problem would make it impossible to find my gun I think
You can set the viewportβs camera to point wherever you want. By default, I think it looks down the positive Z axis or something. You could debug or print out the values to see or just set them to something that makes sense for you.
Ahh!
Add cam.setFrustumFar(1000); to that class and it all works out
Thanks alot