In my 2D games I use Orthographic camera and camera.screen_to_world_bounds(camera_id) to get the screen edges.
In a 3D game I’m playing with, how would I do the same with Rendercam? I’m using an orthographic projection, but the camera is rotated 55 degrees on the x axis. I’ve been playing with rendercam.screen_to_world_plane() but can’t get it working. I am missing something basic no doubt.
Edit: This seems to work, but not quite sure why, because the plane_normal
is an arbitrary number:
local camera_pos = go.get_position("camera")
local sw,sh = window.get_size()
local plane_normal = vmath.vector3(1,0,1)
local top_left = rendercam.screen_to_world_plane(0, 0, plane_normal, vmath.vector3())
local bottom_right = rendercam.screen_to_world_plane(sw, sh, plane_normal, vmath.vector3())