Suche senden
Hochladen
Development with OpenGL and Qt
•
2 gefällt mir
•
3,710 views
Ronny Yabar Aizcorbe
Folgen
Technologie
Melden
Teilen
Melden
Teilen
1 von 32
Empfohlen
OpenGL L01-Primitives
OpenGL L01-Primitives
Mohammad Shaker
Opengl presentation
Opengl presentation
elnaqah
Introduction to open gl in android droidcon - slides
Introduction to open gl in android droidcon - slides
tamillarasan
OpenGL Introduction
OpenGL Introduction
Jayant Mukherjee
Introduction to open_gl_in_android
Introduction to open_gl_in_android
tamillarasan
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
Takao Wada
Programming using opengl in visual c++
Programming using opengl in visual c++
Ta Nam
OpenGL Introduction
OpenGL Introduction
Yi-Lung Tsai
Empfohlen
OpenGL L01-Primitives
OpenGL L01-Primitives
Mohammad Shaker
Opengl presentation
Opengl presentation
elnaqah
Introduction to open gl in android droidcon - slides
Introduction to open gl in android droidcon - slides
tamillarasan
OpenGL Introduction
OpenGL Introduction
Jayant Mukherjee
Introduction to open_gl_in_android
Introduction to open_gl_in_android
tamillarasan
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
Takao Wada
Programming using opengl in visual c++
Programming using opengl in visual c++
Ta Nam
OpenGL Introduction
OpenGL Introduction
Yi-Lung Tsai
Programa de objetos 3 d wire
Programa de objetos 3 d wire
René Domínguez
Grafika komputer 2
Grafika komputer 2
Nur Fadli Utomo
Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)
Robi Parvez
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
Bijoy679
BYO3D 2011: Rendering
BYO3D 2011: Rendering
Matt Hirsch - MIT Media Lab
Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)
Aila Gema Safitri
OpenGL L03-Utilities
OpenGL L03-Utilities
Mohammad Shaker
Open gl tips
Open gl tips
Pedram Mazloom
Ujug07presentation
Ujug07presentation
Bill Adams
Ass day3 1_bd flag
Ass day3 1_bd flag
Robi Parvez
Robot by gulnaz
Robot by gulnaz
Gulnaz Akhter
Robot by gulnaz
Robot by gulnaz
Gulnaz Akhter
The Ring programming language version 1.5.4 book - Part 54 of 185
The Ring programming language version 1.5.4 book - Part 54 of 185
Mahmoud Samir Fayed
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt
EngrZamaan
Bai 1
Bai 1
Châu Thanh Chương
Practicing 2d drawing primitives
Practicing 2d drawing primitives
Technology & Education
CGLabLec6.pptx
CGLabLec6.pptx
Mohammad7Abudosh7
2D Drawing
2D Drawing
Budditha Hettige
opengl.ppt
opengl.ppt
Subiksha57
Intro to Computer Graphics.ppt
Intro to Computer Graphics.ppt
adil104135
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
UXDXConf
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
Mark Opanasiuk
Weitere ähnliche Inhalte
Ähnlich wie Development with OpenGL and Qt
Programa de objetos 3 d wire
Programa de objetos 3 d wire
René Domínguez
Grafika komputer 2
Grafika komputer 2
Nur Fadli Utomo
Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)
Robi Parvez
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
Bijoy679
BYO3D 2011: Rendering
BYO3D 2011: Rendering
Matt Hirsch - MIT Media Lab
Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)
Aila Gema Safitri
OpenGL L03-Utilities
OpenGL L03-Utilities
Mohammad Shaker
Open gl tips
Open gl tips
Pedram Mazloom
Ujug07presentation
Ujug07presentation
Bill Adams
Ass day3 1_bd flag
Ass day3 1_bd flag
Robi Parvez
Robot by gulnaz
Robot by gulnaz
Gulnaz Akhter
Robot by gulnaz
Robot by gulnaz
Gulnaz Akhter
The Ring programming language version 1.5.4 book - Part 54 of 185
The Ring programming language version 1.5.4 book - Part 54 of 185
Mahmoud Samir Fayed
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt
EngrZamaan
Bai 1
Bai 1
Châu Thanh Chương
Practicing 2d drawing primitives
Practicing 2d drawing primitives
Technology & Education
CGLabLec6.pptx
CGLabLec6.pptx
Mohammad7Abudosh7
2D Drawing
2D Drawing
Budditha Hettige
opengl.ppt
opengl.ppt
Subiksha57
Intro to Computer Graphics.ppt
Intro to Computer Graphics.ppt
adil104135
Ähnlich wie Development with OpenGL and Qt
(20)
Programa de objetos 3 d wire
Programa de objetos 3 d wire
Grafika komputer 2
Grafika komputer 2
Ass day2 2_rotating my name (robi)
Ass day2 2_rotating my name (robi)
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
BYO3D 2011: Rendering
BYO3D 2011: Rendering
Tutorial Open GL (Listing Code)
Tutorial Open GL (Listing Code)
OpenGL L03-Utilities
OpenGL L03-Utilities
Open gl tips
Open gl tips
Ujug07presentation
Ujug07presentation
Ass day3 1_bd flag
Ass day3 1_bd flag
Robot by gulnaz
Robot by gulnaz
Robot by gulnaz
Robot by gulnaz
The Ring programming language version 1.5.4 book - Part 54 of 185
The Ring programming language version 1.5.4 book - Part 54 of 185
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt
Bai 1
Bai 1
Practicing 2d drawing primitives
Practicing 2d drawing primitives
CGLabLec6.pptx
CGLabLec6.pptx
2D Drawing
2D Drawing
opengl.ppt
opengl.ppt
Intro to Computer Graphics.ppt
Intro to Computer Graphics.ppt
Kürzlich hochgeladen
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
UXDXConf
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
Mark Opanasiuk
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
Stephanie Beckett
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
FIDO Alliance
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
FIDO Alliance
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
panagenda
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
CzechDreamin
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
shyamraj55
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
BrainSell Technologies
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
Hiroshi SHIBATA
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
FIDO Alliance
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
Jennifer Lim
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Leah Henrickson
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
Neo4j
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
UXDXConf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
FIDO Alliance
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
Patrick Viafore
Kürzlich hochgeladen
(20)
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
Development with OpenGL and Qt
1.
3D Development with Qt
2.
Agenda
3D Concepts OpenGL Qt + OpenGL
3.
4.
5.
We need an API
6.
Graphics rendering API
7.
Current industry standard for 3D graphics
( Hi DirectX! )
8.
MultiPlatform
MultiLanguage Hardware Independent Open Standard
9.
More than 250 functions to produce
threedimensional scenes glColor, glVertex, glTranslate, glRotate ...
10.
Geometric Primitives
11.
12.
Camera Physical locations Projection properties
13.
Lighting glEnable ( GL_LIGHTING ) Lighting simulates how objects reflect light Material composition Light’s color and position Two sided GLfloat mred[4]= {1,0,0,1}; glMaterialfv(GL_FRONT, GL_AMBIENT, mred);
14.
Primitives are specified: glBegin(primitiveType); … … glEnd(); Example: glBegin(GL_TRIANGLES); glVertex3f( 0.0, 1.0, 0.0 ); glVertex3f( 1.0, 1.0, 0.0 ); glVertex3f( 1.0, 1.0, 0.0 ); glEnd();
15.
Color
16.
The human eye has 3 types of light receptor
cells glColor3f ( GLfloat red, GLfloat green, GLfloat blue );
17.
glBegin(GL_TRIANGLES); // red glColor3f( 1.0, 0.0, 0.0 ); glVertex3f( 0.0, 1.0, 0.0 ); // green glColor3f( 0.0, 1.0, 0.0 ); glVertex3f( 1.0, 1.0, 0.0 ); // blue glColor3f( 0.0, 0.0, 1.0 ); glVertex3f( 1.0, 1.0, 0.0 ); glEnd();
18.
Shading Smooth: glShadeModel ( GL_SMOOTH ); Flat: glShadeModel ( GL_FLAT );
19.
// Smooth shading glShadeModel(GL_SMOOTH); glBegin(GL_TRIANGLE_STRIP); glColor3( 0.0, 0.5, 0.0 ); glVertex3( 1.0, 0.5, 5.0 ); glColor3( 1.0, 0.0, 0.0 ); glVertex3( 1.0, 0.5, 5.0 ); glColor3( 1.0, 0.0, 0.0 ); glVertex3( 0.0, 0.5, 5.0 ); glColor3( 1.0, 0.0, 0.0 ); glVertex3( 1.5, 0.0, 5.0 ); glColor3( 0.0, 0.0, 1.0 ); glVertex3( 2.0, 1.5, 5.0 );
glEnd();
20.
// Flat shading glShadeModel(GL_FLAT); glBegin(GL_TRIANGLE_STRIP); glColor3( 0.0, 0.5, 0.0 ); glVertex3( 1.0, 0.5, 5.0 ); glColor3( 1.0, 0.0, 0.0 ); glVertex3( 1.0, 0.5, 5.0 ); glColor3( 1.0, 0.0, 0.0 ); glVertex3( 0.0, 0.5, 5.0 ); glColor3( 1.0, 0.0, 0.0 ); glVertex3( 1.5, 0.0, 5.0 ); glColor3( 0.0, 0.0, 1.0 ); glVertex3( 2.0, 1.5, 5.0 );
glEnd();
21.
glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR );
22.
23.
+
Qt OpenGL module
24.
#include <QGLWidget> class GLWidget : public QGLWidget { Q_OBJECT public: GLWidget( QWidget *parent=0 ); ~GLWidget(); ... protected: void initializeGL(); void resizeGL( int width, int height ); void paintGL(); private: ...
};
25.
void initializeGL(); void resizeGL( int width, int height ); void paintGL();
26.
void GLWidget::initializeGL()
{ // Smooth shading glShadeModel( GL_SMOOTH ); // Background color glClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); > qglClearColor( Qt::black ); // Depth buffer setup glClearDepth( 1.0f ); // Enable depth testing glEnable( GL_DEPTH_TEST ); // Set type of depth test glDepthFunc( GL_LEQUAL ); }
27.
void GLWidget::resizeGL( int width, int height )
{ if ( height == 0 ) height = 1; // Reset current viewport GlViewport( 0, 0, width, height ); // Select projection matrix GlMatrixMode( GL_PROJECTION ); // Reset projection matrix glLoadIdentity(); // Select modelview matrix GlMatrixMode( GL_MODELVIEW ); // Reset modelview matrix glLoadIdentity();
28.
void GLWidget::paintGL()
{ glClear ( GL_COLOR_BUFFER_BIT ); // Reset the drawing perspective glLoadIdentity(); // triangle glBegin (GL_TRIANGLES); GlColor3f ( 1.0, 0.0, 0.0 ); glVertex3f ( 5.0, 5.0, 0.0 ); glColor3f ( 0.0, 1.0, 0.0 ); glVertex3f ( 25.0, 5.0, 0.0 ); glColor3f ( 0.0, 0.0, 1.0 ); GlVertex3f ( 5.0, 25.0, 0.0 ); glEnd(); }
29.
void GLWidget::drawtriangle() { glBegin ( GL_TRIANGLES ); glColor3f ( 1.0, 0.0, 0.0 ); glVertex3f ( 5.0, 5.0, 0.0 ); glColor3f ( 0.0, 1.0, 0.0 ); glVertex3f ( 25.0, 5.0, 0.0 ); glColor3f ( 0.0, 0.0, 1.0 ); glVertex3f ( 5.0, 25.0, 0.0 ); glEnd(); } void GLWidget::paintGL() { glClear ( GL_COLOR_BUFFER_BIT ); // Reset the drawing perspective glLoadIdentity();
drawTriangle();
30.
Demo Animation
31.
Demo Rotation
32.
Thanks
Ronny Yabar Aizcorbe ronnycontacto@gmail.com ronnyml.wordpress.com