Can I render an object ontop of everything, but under gui?

Lol! Sorry :stuck_out_tongue:

I didnt know there was 2 pages on this post and read only your reply on the first :stuck_out_tongue:



Ill try to use your code now :smiley: Thanks :slight_smile:

That is awsome :smiley: It actually works!! :slight_smile:



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 :confused:

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.

2 Likes

Ahh!

Add cam.setFrustumFar(1000); to that class and it all works out :smiley:



Thanks alot :slight_smile: