I've been working on a Python script that does some 3D processing on some data I have, without actually rendering anything (I want to take advantage of the
pointInsideFrustum mechanics, which is hard to find decoupled from a full-fledged graphics library). Basically what I'm doing is moving around cameras, projecting a ray from the camera, raycasting with some model, and testing what other camera poses' frustums contain that point.
Anyway, the issue I'm having is that when I try to move a camera in my script (done using both the
Object, for good measure; I also tried using
applyRotation with limited success). While the position seems to be updated, it seems like it doesn't register. Namely, I perform a check to make sure that the camera can see the point that is returned from raycasting via
pointInsideFrustum. However, it doesn't detect anything. I delay the script being run until after the first tick, so that the projection matrix can be initialized. Indeed, after checking, the projection matrix is in fact initialized, so that's not the problem.
However, the logic in the code works correctly, since, after restarting the code in game engine mode, it works fine. However, after moving the camera (in the code) to a position far enough away, it fails again. This leads me to believe that the camera isn't actually moving, or that it isn't properly registering. I suspect this might have to do with logic ticks in the Python script. From some other posts elsewhere that I've read, I suspect that Python scripts only are run in a single logic tick, though I'm not certain. If this is the case though, is there a way to make it run over multiple logic ticks?
It's important that this script be constantly running. As bad as it might sound, I have a web server running inside of this script, for the purpose of being able to do some processing via API requests.