Advice on how to access rendered window images.
by Kevin Stokes · in Torque Game Engine · 04/09/2005 (10:17 pm) · 1 replies
Greetings,
I have recently purchased the torque engine for research into robotic terrain/object sensing. What I am doing is developing algorithms for robot vision systems. I've got some test worlds built, and have succesfully compiled the engine from the source.
The game engine is fantastic, and I'm convinced it will be perfect for what I want. In the past I have done my own 3D programming using Direct 3D, but with Torque I will be able to concentrate on my task at hand. I'm hoping that some experts can give me advice on how they would proceed.
I have three main questions:
1.) Where in the code can I get access to an RGB image representing the current 3D rendered world? I would like to hook into the main loop and start adding my own routines for analyzing the images as if the data were coming from a video camera. Where in the Torque source code would I start, and assuming my code will be a CPU hog, are there any gotchas I should look out for?
2.) Are there calls I can make to get a list of objects (and their coordinates and bounding box sizes) that are in (or likely to be in) the currently rendered frame?
3.) I would like to record the motion so I can run it repeatedly in exactly the same way as I make changes to my processing. I noticed with F3 I can record a stream of events. Is there existing code to replay the motion from those recorded files? How would I go about doing this?
4.) (Sorry, I can program, but I can't count very well.) What is the easist way to display an additional window (or simply an area of the 3D view) with my own processed image in realtime along with the normal rendered view?
Thanks very much in advance.
-Kevin Stokes
I have recently purchased the torque engine for research into robotic terrain/object sensing. What I am doing is developing algorithms for robot vision systems. I've got some test worlds built, and have succesfully compiled the engine from the source.
The game engine is fantastic, and I'm convinced it will be perfect for what I want. In the past I have done my own 3D programming using Direct 3D, but with Torque I will be able to concentrate on my task at hand. I'm hoping that some experts can give me advice on how they would proceed.
I have three main questions:
1.) Where in the code can I get access to an RGB image representing the current 3D rendered world? I would like to hook into the main loop and start adding my own routines for analyzing the images as if the data were coming from a video camera. Where in the Torque source code would I start, and assuming my code will be a CPU hog, are there any gotchas I should look out for?
2.) Are there calls I can make to get a list of objects (and their coordinates and bounding box sizes) that are in (or likely to be in) the currently rendered frame?
3.) I would like to record the motion so I can run it repeatedly in exactly the same way as I make changes to my processing. I noticed with F3 I can record a stream of events. Is there existing code to replay the motion from those recorded files? How would I go about doing this?
4.) (Sorry, I can program, but I can't count very well.) What is the easist way to display an additional window (or simply an area of the 3D view) with my own processed image in realtime along with the normal rendered view?
Thanks very much in advance.
-Kevin Stokes
Associate Kyle Carter
2) You can get the info out of the scenegraph, which generates the list as part of the rendering process.
3) If you want an exact playback I suggest using journalling, which will feed back the exact same set of input events as happened on a previously recorded run. The demo recording is not really the best fit for this task.
4) Make a new GUI control to do it?