Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pulsatingscience
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
einsteinathome
pulsatingscience
Commits
1d633f57
Commit
1d633f57
authored
Jul 29, 2010
by
Oliver Bock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed rendering order (solves background texture vs. transparent foreground texture issue)
parent
f3ec031e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
32 deletions
+36
-32
src/pulsaranimationwidget.cpp
src/pulsaranimationwidget.cpp
+36
-32
No files found.
src/pulsaranimationwidget.cpp
View file @
1d633f57
...
...
@@ -250,6 +250,7 @@ void PulsarAnimationWidget::paintGL()
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
// initial perspective/camera setup
glMatrixMode
(
GL_MODELVIEW
);
glLoadIdentity
();
...
...
@@ -257,6 +258,41 @@ void PulsarAnimationWidget::paintGL()
0.0
,
0.0
,
0.0
,
0.0
,
1.0
,
0.0
);
// save current state (the following is using parallel projection)
glMatrixMode
(
GL_PROJECTION
);
glPushMatrix
();
{
glLoadIdentity
();
glOrtho
(
0
,
width
(),
0
,
height
(),
0.1
,
501.0
);
glMatrixMode
(
GL_MODELVIEW
);
glPushMatrix
();
{
glLoadIdentity
();
// draw copyright info
glColor4f
(
1.0
f
,
1.0
f
,
1.0
f
,
0.5
f
);
QFont
font
;
font
.
setPointSize
(
11
);
font
.
setBold
(
true
);
font
.
setFamily
(
"Arial"
);
font
.
setStyleStrategy
((
QFont
::
StyleStrategy
)
(
QFont
::
OpenGLCompatible
|
QFont
::
PreferQuality
));
renderText
(
10
,
25
,
-
100
,
QString
::
fromLocal8Bit
(
"Copyright © 2009-2010"
),
font
);
renderText
(
10
,
10
,
-
100
,
QString
::
fromLocal8Bit
(
"Max-Planck-Insitut für Gravitationsphysik"
),
font
);
// draw backdrop
glColor3f
(
1.0
f
,
1.0
f
,
1.0
f
);
glTranslatef
(
0.0
,
0.0
,
-
501.0
);
drawTexture
(
QPointF
(
0.0
,
0.0
),
m_backgroundTexture
);
// restore original state
glMatrixMode
(
GL_PROJECTION
);
}
glPopMatrix
();
glMatrixMode
(
GL_MODELVIEW
);
}
glPopMatrix
();
// define materials
// TODO: should be located elsewhere
static
GLfloat
no_mat
[]
=
{
0.0
,
0.0
,
0.0
,
1.0
};
static
GLfloat
mat_diffuse
[]
=
{
0.5
,
0.5
,
0.5
,
1.0
};
...
...
@@ -479,39 +515,7 @@ void PulsarAnimationWidget::paintGL()
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
// save current state
glMatrixMode
(
GL_PROJECTION
);
glPushMatrix
();
{
glLoadIdentity
();
glOrtho
(
0
,
width
(),
0
,
height
(),
0.1
,
501.0
);
glMatrixMode
(
GL_MODELVIEW
);
glPushMatrix
();
{
glLoadIdentity
();
// draw copyright info
glColor4f
(
1.0
f
,
1.0
f
,
1.0
f
,
0.5
f
);
QFont
font
;
font
.
setPointSize
(
11
);
font
.
setBold
(
true
);
font
.
setFamily
(
"Arial"
);
font
.
setStyleStrategy
((
QFont
::
StyleStrategy
)
(
QFont
::
OpenGLCompatible
|
QFont
::
PreferQuality
));
renderText
(
10
,
25
,
-
100
,
QString
::
fromLocal8Bit
(
"Copyright © 2009-2010"
),
font
);
renderText
(
10
,
10
,
-
100
,
QString
::
fromLocal8Bit
(
"Max-Planck-Insitut für Gravitationsphysik"
),
font
);
// draw backdrop (independent parallel projection)
glColor3f
(
1.0
f
,
1.0
f
,
1.0
f
);
glTranslatef
(
0.0
,
0.0
,
-
501.0
);
drawTexture
(
QPointF
(
0.0
,
0.0
),
m_backgroundTexture
);
// restore original state
glMatrixMode
(
GL_PROJECTION
);
}
glPopMatrix
();
glMatrixMode
(
GL_MODELVIEW
);
}
glPopMatrix
();
}
void
PulsarAnimationWidget
::
runAnimation
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment