Nachtwind
12-10-2005 16:34:47
Hi!
Is it already possible to render something into a picturebox (or similar)?
All i would need to do is rendering very very many spheres into a "window" and may have the possibility to turn this into all directions as well as zoom into or out of it...
Btw, is it somehow possible to override this Ogre configuiration window (Donk think so as it seemed to be called by the ExampleApplication which is part of ogre.net?)
fifty1
12-10-2005 16:55:59
Check the DemoWinForms project in the source download. Basically just call Root.Initialise() and pass it a WinForms Control.
You don't need to use the Ogre config dialog. Just set up ogre.cfg with the appropriate options and you're done. In fact, if you're rendering to a WinForms Control, the only parts of Ogre.cfg that matter are the render system and full-scene anti-aliasing options.
Nachtwind
17-10-2005 21:03:39
well, after trieing arround i didnt find the right switch to turn off that dialog :/
So may i ask what that might be?
EagleEye
17-10-2005 21:30:45
You can't turn off that option if you're inheriting from example application.
If you are creating your own stand-alone app, you won't be wanting to use example application anyway. Simply ensure that ogre.cfg is in the application folder and you don't need to call the ShowConfigdialog function at all.
As far as your original question, if you mean a "picture box" like an overlay, you will have to use "Render To Texture". It involves adding a viewport to a "RenderTexture" type object. RenderTexture inherits from RenderTarget, just like the RenderWindow does. This allows it to accept a viewport.
It converts whatever the viewport is rendering in to a texture that you can apply as a material's texture to a flat surface.
This would be how you could do something like show a TV's flat surface in the game, or a rear-view mirror on a car. Simply set the material for the surface of the TV screen or mirror to the material that uses that texture that is accepting the render data from that camera/viewport combo, and you have yourself a picturebox that is rendering a different part of the scene within the main viewport.
EagleEye
17-10-2005 21:31:13
I should note that all of the above is the theory as I understand it...
Getting it to work? I haven't done that yet.
Nachtwind
17-10-2005 22:29:22
well, that had been two different questions, but that all is quite interestering. I didnt manage to make a picturebox on a form contain a 3d scene yet - but i didnt try it that hard, and the second thing was too obvious... bad thing... simple let the exampleapplication stay away... *shakes his head* shame on me...