I was faced with the problem of obtaining images from cameras in blender game engine. Can anyone help me with this?
Ideally I need transform images to arrays and transfer data using sockets. But, as a last resort, I'll be happy with the option of saving images into folders.
I will not satisfied with the screenshots, using bge.render.makeScreenshot(filename), because I need multiple cameras.
If I succeed in this, I promise to make a tutorial in Youtube about it and share all source files ;)
ADDITION: I've tried to use script from this link:
from bge import logic, render camList = logic.getCurrentScene().cameras cont = logic.getCurrentController() own = cont.owner cam1 = camList['Camera_LEFT'] cam2 = camList['Camera_RIGHT'] width = render.getWindowWidth() height = render.getWindowHeight() cam1.setViewport(0, 0, int(width/2), height) cam2.setViewport(int(width/2), 0, width, height) cam1.useViewport = True cam2.useViewport = True folder = '//image-#.png' render.makeScreenshot(folder)