SetHpr issues, pulling hair out

This can be done, I believe, but if I may, there may be an easier method of doing what you’re attempting. I take it that you’re attempting to convert 2D screen coordinates to 3D world coordinates.

First, if your target objects are arranged on a single plane, then you can use this method to pick points on that plane based on mouse coordinates.

If the objects are not arranged on a plane, then the “extrude” method used in the above suggestion may still be of use (but don’t use “extrudeVec”–that’s apparently intended for curved lenses).

Given a 2D point in the range (-1, 1) on both axes (such as mouse coordinates), “extrude” fills in the supplied point parameters with the resulting 3D near- and far- points corresponding to the vector passing through that 2D point on the lens. Given that, you can subtract one from the other (and normalise the result) to produce a direction vector; if you know how far it is to the target, then multiplying the direction vector by that distance should give you the location of the target point.

(You may also find “getRelativePoint”–again, as used in the first-mentioned suggestion–called for in order to get the points into the correct space.)

However, to answer your actual question, I believe that you can get the screen size as follows:

if base.win.hasSize():
    winWidth = base.win.getXSize()
    winHeight = base.win.getYSize()