Hi , again
it's true that this idea is what i want
III. Use OpenGL build in view-port support (this is easiest and probably what You want)
This will DIVIDE Your main OgreWidget into smaller areas, where You can show scene from different cameras.
Minus is that You can't move independently those smaller areas around screen, they are part of main widget.
(google it).
But bbecause the viewport is a part from main widget ,and i can't add dynamically the viewport i can't use it
i think to use this idea it's the most appropriate idea
II. Posted by me in previous reply.
1.
Create template QWidget with qdock widget and Actual Ogre widget.
That is your main viewport class, and also WILL be used as Main window.
1a.
In "Template" QWidget do Ogre initialization i.
e.
in event onShow
() or simply in constructor on the
QWidget subclass.
2. Initialize FIRST widget, place it in MainWindow (or whatever name Your basic class name is), this is Your main Ogre widget and append it to the list at first position i.e. QList<YourQWidgetSubclassWithOgre*> widgetList;.
2a. Build VBO/DisplayList for Your 3D mesh data, create shaders etc...
3. When "new camera" is requested create that widget on the heap and add it to the list i.e. QList<YourQWidgetSubclassWithOgre*> widgetList;.
3a. Pass, from the FIRST WIDGET - from step 2a., to that subclass, pointers to the 3D data, meshes, shaders and paint them in that new camera view.
Note. Now all data is in the GPU memory so there is no need to send again same data so simply reuse the data.
4. Show New Camera widget.
5. Change Camera position in that new Camera View.
II. Posted by me in previous reply.
1. Create template QWidget with qdock widget and Actual Ogre widget. That is your main viewport class, and also WILL be used as Main window.
1a. In "Template" QWidget do Ogre initialization i.e. in event onShow() or simply in constructor on the QWidget subclass.
2. Initialize FIRST widget, place it in MainWindow (or whatever name Your basic class name is), this is Your main Ogre widget and append it to the list at first position i.e. QList<YourQWidgetSubclassWithOgre*> widgetList;.
2a. Build VBO/DisplayList for Your 3D mesh data, create shaders etc...
3. When "new camera" is requested create that widget on the heap and add it to the list i.e. QList<YourQWidgetSubclassWithOgre*> widgetList;.
3a. Pass, from the FIRST WIDGET - from step 2a., to that subclass, pointers to the 3D data, meshes, shaders and paint them in that new camera view.
Note. Now all data is in the GPU memory so there is no need to send again same data so simply reuse the data.
4. Show New Camera widget.
5. Change Camera position in that new Camera View.
To copy to clipboard, switch view to plain text mode
But i have some questions
1. Create template QWidget with qdock widget and Actual Ogre widget. That is your main viewport class, and also WILL be used as Main window.
1a. In "Template" QWidget do Ogre initialization i.e. in event onShow() or simply in constructor on the QWidget subclass.
like how i do in my project the first time ?
MainWindow::MainWindow()
{
ogreWidget = new OgreWidget(this);
setCentralWidget(ogreWidget);
createActionMenus();
createDockWidget();
}
MainWindow::MainWindow()
{
ogreWidget = new OgreWidget(this);
setCentralWidget(ogreWidget);
createActionMenus();
createDockWidget();
}
To copy to clipboard, switch view to plain text mode
and for my ogre insialization it is in the ogrewidget initalisation
ogrewidget in viewport
void OgreWidget::createViewports(void)
{
// Create one viewport, entire window
Ogre::Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
// Alter the camera aspect ratio to match the viewport
mCamera->setAspectRatio(
Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
}
void OgreWidget::createViewports(void)
{
// Create one viewport, entire window
Ogre::Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
// Alter the camera aspect ratio to match the viewport
mCamera->setAspectRatio(
Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
}
To copy to clipboard, switch view to plain text mode
Note: when i create new camera and new widget i change mcamera by te new camera but mwindow is i change it by my new widget? OR I ADD IN THE INITIALIZATION OF OGREWIDGET PARAMETER THE NAME OF THE WIDGET(OGREwIDGET OR THE NEW WIDGETS ) WITH THAT HE WILL CREATE TO ME MANY MAINWINDOW??
with this code i can see in my window what the camera see.
2. Initialize FIRST widget, place it in MainWindow (or whatever name Your basic class name is), this is Your main Ogre widget and append it to the list at first position i.e. QList<YourQWidgetSubclassWithOgre*> widgetList;.
the first widget is
ogreWidget in my case ?
MainWindow::MainWindow()
{
ogreWidget = new OgreWidget(this);
setCentralWidget(ogreWidget);
MainWindow::MainWindow()
{
ogreWidget = new OgreWidget(this);
setCentralWidget(ogreWidget);
To copy to clipboard, switch view to plain text mode
2a. Build VBO/DisplayList for Your 3D mesh data, create shaders etc...
you mean i create my scene and show it ?or whatb you mean by " Build VBO/DisplayList"
3a. Pass, from the FIRST WIDGET - from step 2a., to that subclass, pointers to the 3D data, meshes, shaders and paint them in that new camera view.
Note. Now all data is in the GPU memory so there is no need to send again same data so simply reuse the data.
what you mean her?i did not understand this step
i ma sorry because i ask many question but i can't found idea or exemple similat as what i want to do
Bookmarks