Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GraPa
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
GraPa
Commits
46c09afb
Commit
46c09afb
authored
Nov 02, 2015
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed material shader Bug
parent
25092db6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
cubewidget.cpp
A1/hellocube/cubewidget.cpp
+12
-6
No files found.
A1/hellocube/cubewidget.cpp
View file @
46c09afb
...
...
@@ -86,8 +86,8 @@ void CubeWidget::paintGL ( )
GLfloat
yellow
[]
=
{
1.0
,
1.0
,
0.0
};
float
increment
=
1.0
/
(
pow
(
2
,
tesselation
));
glBegin
(
GL_QUADS
);
setMaterial
(
red
);
glBegin
(
GL_QUADS
);
glNormal3f
(
0
,
1
,
0
);
for
(
float
x
=
-
0.5
;
x
<
0.5
;
x
+=
increment
)
{
for
(
float
y
=
-
0.5
;
y
<
0.5
;
y
+=
increment
)
{
...
...
@@ -99,8 +99,9 @@ void CubeWidget::paintGL ( )
}
glEnd
();
glBegin
(
GL_QUADS
);
setMaterial
(
magenta
);
glBegin
(
GL_QUADS
);
glNormal3f
(
0
,
-
1
,
0
);
for
(
float
x
=
-
0.5
;
x
<
0.5
;
x
+=
increment
)
{
for
(
float
y
=
-
0.5
;
y
<
0.5
;
y
+=
increment
)
{
...
...
@@ -112,8 +113,9 @@ void CubeWidget::paintGL ( )
}
glEnd
();
glBegin
(
GL_QUADS
);
setMaterial
(
green
);
glBegin
(
GL_QUADS
);
glNormal3f
(
0
,
0
,
1
);
for
(
float
x
=
-
0.5
;
x
<
0.5
;
x
+=
increment
)
{
for
(
float
y
=
-
0.5
;
y
<
0.5
;
y
+=
increment
)
{
...
...
@@ -125,8 +127,9 @@ void CubeWidget::paintGL ( )
}
glEnd
();
glBegin
(
GL_QUADS
);
setMaterial
(
yellow
);
glBegin
(
GL_QUADS
);
glNormal3f
(
0
,
0
,
-
1
);
for
(
float
x
=
-
0.5
;
x
<
0.5
;
x
+=
increment
)
{
for
(
float
y
=
-
0.5
;
y
<
0.5
;
y
+=
increment
)
{
...
...
@@ -138,8 +141,9 @@ void CubeWidget::paintGL ( )
}
glEnd
();
glBegin
(
GL_QUADS
);
setMaterial
(
blue
);
glBegin
(
GL_QUADS
);
glNormal3f
(
-
1
,
0
,
0
);
for
(
float
x
=
-
0.5
;
x
<
0.5
;
x
+=
increment
)
{
for
(
float
y
=
-
0.5
;
y
<
0.5
;
y
+=
increment
)
{
...
...
@@ -150,8 +154,10 @@ void CubeWidget::paintGL ( )
}
}
glEnd
();
glBegin
(
GL_QUADS
);
setMaterial
(
cyan
);
glBegin
(
GL_QUADS
);
glNormal3f
(
1
,
0
,
0
);
for
(
float
x
=
-
0.5
;
x
<
0.5
;
x
+=
increment
)
{
for
(
float
y
=
-
0.5
;
y
<
0.5
;
y
+=
increment
)
{
...
...
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