Hi there!
I'm trying to provide a kind of "observer" in a game, which operates via tcpip.
The observer is defined by a camera. My idea is to render the scene to a texture (like in the TestCameraMan.java example!).
Then I would like to get an image of this texture. I tried to somehow access the rendered data, but the "image"-attribute of the texture is null and I don't know where the texture-information is stored! Anyone an idea how to get a kind of "Image"-Object from a (rendered) texture??
Thanks a lot!
Up!
(Because I'm also very interested in this: the idea is to use the rendered texture OUTSIDE of the GL canvas…)
Thx
I don't know if there is a way to bring a texture from video memory so you can use it. Have a look at OpenGL.
Something that perhaps you could do is :
- Set the viewport to the size you want to use for the spectator.
- Render the scene from the "spectator".
- Take the data from the framebuffer using Renderer.grabScreenContents().
- Set the viewport again for the "real" camera.
- Render the scene.
- Swap buffers.
I wonder how slow this can be :evil:
Regards!
Hmm… Ugly as sin, but worth trying, thanks!
I'll let you know how it goes…
Other idea, anyone?