Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OpenGL
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
C-Fu
OpenGL
Commits
4c40d140
Commit
4c40d140
authored
8 years ago
by
Anakin
Browse files
Options
Downloads
Patches
Plain Diff
cloth now has specular
parent
f47e1cc7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
QtMeshViewer/Header/FileInterface.h
+2
-2
2 additions, 2 deletions
QtMeshViewer/Header/FileInterface.h
QtMeshViewer/Source/MshFile.cpp
+19
-4
19 additions, 4 deletions
QtMeshViewer/Source/MshFile.cpp
with
21 additions
and
6 deletions
QtMeshViewer/Header/FileInterface.h
+
2
−
2
View file @
4c40d140
...
...
@@ -42,10 +42,10 @@ struct Material {
QString
tx3d
;
QOpenGLTexture
*
texture0
=
Q_NULLPTR
;
QOpenGLTexture
*
texture1
=
Q_NULLPTR
;
QVector4D
specularColor
=
{
1.0
,
1.0
,
1.0
,
1.0
};
QVector4D
specularColor
=
{
0.1
f
,
0.1
f
,
0.1
f
,
1.0
};
QVector4D
diffuseColor
=
{
1.0
,
0.0
,
0.0
,
1.0
};
QVector4D
ambientColor
=
{
1.0
,
1.0
,
1.0
,
1.0
};
float
shininess
=
80
;
float
shininess
=
1
;
bool
flags
[
8
]
=
{
false
};
bool
transparent
=
false
;
quint8
rendertype
=
0
;
...
...
This diff is collapsed.
Click to expand it.
QtMeshViewer/Source/MshFile.cpp
+
19
−
4
View file @
4c40d140
#include
"..\Header\MshFile.h"
#include
"..\Header\tga.h"
#include
"..\Header\OutputDevice.h"
#include
<QVector3D>
// helper function to save data from file to any variable type
...
...
@@ -662,12 +663,26 @@ void MshFile::analyseClthChunks(Model * dataDestination, QList<ChunkHeader*>& ch
m_file
.
read
(
F2V
(
tmp_size
),
sizeof
(
tmp_size
));
// for every triangle..
for
(
unsigned
int
i
=
0
;
i
<
tmp_size
*
3
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
tmp_size
;
i
++
)
{
quint32
tmp_value
;
m_file
.
read
(
F2V
(
tmp_value
),
sizeof
(
quint32
));
quint32
tmp_value
[
3
];
for
(
unsigned
int
j
=
0
;
j
<
3
;
j
++
)
{
m_file
.
read
(
F2V
(
tmp_value
[
j
]),
sizeof
(
quint32
));
new_segment
->
indices
.
push_back
((
GLuint
)
tmp_value
[
j
]);
}
new_segment
->
indices
.
push_back
((
GLuint
)
tmp_value
);
QVector3D
vec1
,
vec2
,
norm
;
vec1
=
new_segment
->
vertices
[
new_segment
->
indices
[
i
*
3
]].
position
-
new_segment
->
vertices
[
new_segment
->
indices
[
i
*
3
+
1
]].
position
;
vec2
=
new_segment
->
vertices
[
new_segment
->
indices
[
i
*
3
]].
position
-
new_segment
->
vertices
[
new_segment
->
indices
[
i
*
3
+
2
]].
position
;
norm
=
QVector3D
::
crossProduct
(
vec1
,
vec2
);
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
new_segment
->
vertices
[
new_segment
->
indices
[
i
*
3
+
k
]].
vertexNormal
+=
norm
;
new_segment
->
vertices
[
new_segment
->
indices
[
i
*
3
+
k
]].
vertexNormal
.
normalize
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment