Grab frames from camera

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
redroyalty@fastmail.fm
Posts: 3
Joined: Sat Jun 12, 2004 8:45 pm

Grab frames from camera

Post by redroyalty@fastmail.fm »

Hi,
Is it possibel to grab frames from a camerascennode? I'm planning to make a simple robotics simulator. Most robots use sonar and cameras as there sensors. To simulate that I want to use one or two cameras as the eyes of the robot. Is there any way to periodically request frames from those cameras? So "the robot" can do some filtering on that image.

Thanks in advance, Arco.
Gorgon Zola
Posts: 118
Joined: Thu Sep 18, 2003 10:05 pm
Location: switzerland

Post by Gorgon Zola »

from irr::video::IVideoDriver

Code: Select all

//! Sets a new render target. This will only work, if the driver
//! supports the EVDF_RENDER_TO_TARGET feature, which can be 
//! queried with queryFeature().
//! \param texture: New render target.
virtual void setRenderTarget(video::ITexture* texture) = 0;
redroyalty@fastmail.fm
Posts: 3
Joined: Sat Jun 12, 2004 8:45 pm

Post by redroyalty@fastmail.fm »

Thanks for your reply.
But according to queryFeature only software rendering supports this method. Also this doesn't seem to work on a single camera but renders the whole frame to a picture.
So does anyone knows a different approach?
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

i'm also looking for a way to do this... maybe some getpixel opengl code or something?
redroyalty@fastmail.fm
Posts: 3
Joined: Sat Jun 12, 2004 8:45 pm

Post by redroyalty@fastmail.fm »

For those who are interested. I did some googling and found the following links which seem to address my problem. I will try to hack this into irrlicht but I don't know if I will succeed.

Arco.

Using P-Buffers for Off-Screen Rendering in OpenGL
http://developer.nvidia.com/object/PBuf ... creen.html

GDC2002 -- OpenGL Render-to-Texture
http://developer.nvidia.com/object/gdc_oglrtt.html

Project which uses these extentions
http://www.paulsprojects.net/opengl/rtotex/rtotex.html

OpenGL Render To Texture
This demo shows the usage of render-to-texture in OpenGL through the WGL_ARB_render_texture extension.
http://developer.nvidia.com/object/ogl_rtt.html
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

Cool, if someone get this working it would be a step towards being able to save screenshots for save-game files and such
Post Reply