Hi aamer4yu,
Thanks for your reply
also saw the image u gave... well as far as i got it, u work in 2D and want to show them in 3D....
Yes you are in right path. I already have some 2D objects and want to show them in 3D.
well if u have fixes number of items, and know what items will be drawn, u can create a different view and add 3D objects to it
Is different view a QGlwidget???. If yes I tried it. But get only 2D view.
Now here is the main issue. How do I create a different view and add 3D objects to it. My sense says something like this
//GraphicsView
paint( &painter );
}
void graphicsView
::paint( QPainter* painter
){ //Draw the object you want
}
void graphicsView::on3DViewerButtonClick(){
m_glWid = new myGLWidget( this ); //here this is QGraphicsView
m_glWid->show();
}
void graphicsView::paintEvent( QPaintEvent * event ){
QPainter painter(this);
paint( &painter );
}
void graphicsView::paint( QPainter* painter ){
//Draw the object you want
}
void graphicsView::on3DViewerButtonClick(){
m_glWid = new myGLWidget( this ); //here this is QGraphicsView
m_glWid->show();
}
To copy to clipboard, switch view to plain text mode
Now I got graphicsView object in QGLWidget. How do I proceed further. I know I need to override
paintGL()
resizeGL()
initializeGL()
paintGL()
resizeGL()
initializeGL()
To copy to clipboard, switch view to plain text mode
I can even use paintEvent in GLWidget and the call paint member of GraphicsView like this
painter.begin(this);
m_graphicsView->paint(&painter);
painter.end();
}
void GLWidget::paintEvent( QPaintEvent * event ){
QPainter painter;
painter.begin(this);
m_graphicsView->paint(&painter);
painter.end();
}
To copy to clipboard, switch view to plain text mode
But now I get 2D on QGLWidget.
Did you mean something like this. Or Is there something else.
and yeah, is ur 3D view editable ??? i mean do u want items to be manipulated in 3D view, or just show a 3D view of the items ??
[/QUOTE]
Yes in some scenario. First I would be interested in representing a 2D object to 3D. If I succeed then move ahead for editing.
Hope I made some sense now. PLease let me know if still there is any confusion.
I'll go through the link you have given and see if I can get it.
Thanks
//I want through the link and could not find QTransform in qt4.2.2.
Bookmarks