Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
OpenGL
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
C-Fu
OpenGL
Commits
fc7941a8
Commit
fc7941a8
authored
Jan 02, 2017
by
Anakin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed rotation problem
parent
24d26cfd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
QtMeshViewer/Header/FileInterface.h
QtMeshViewer/Header/FileInterface.h
+1
-0
QtMeshViewer/Source/GeometryEngine.cpp
QtMeshViewer/Source/GeometryEngine.cpp
+1
-0
QtMeshViewer/Source/MshFile.cpp
QtMeshViewer/Source/MshFile.cpp
+2
-1
No files found.
QtMeshViewer/Header/FileInterface.h
View file @
fc7941a8
...
...
@@ -30,6 +30,7 @@ struct Model {
std
::
string
name
=
""
;
std
::
string
parent
=
""
;
QMatrix4x4
m4x4Translation
;
QQuaternion
quadRotation
;
std
::
vector
<
Segment
*>
segmList
;
};
...
...
QtMeshViewer/Source/GeometryEngine.cpp
View file @
fc7941a8
...
...
@@ -59,6 +59,7 @@ void GeometryEngine::loadFile(const char* filePath)
new_info
.
size
=
segmentIterator
->
indices
.
size
();
new_info
.
textureIndex
=
segmentIterator
->
textureIndex
;
new_info
.
modelMatrix
=
modelIterator
->
m4x4Translation
;
new_info
.
modelMatrix
.
rotate
(
modelIterator
->
quadRotation
);
// add offset to indices
for
(
auto
&
it
:
segmentIterator
->
indices
)
...
...
QtMeshViewer/Source/MshFile.cpp
View file @
fc7941a8
...
...
@@ -293,8 +293,9 @@ void MshFile::analyseModlChunks(Model * dataDestination, std::list<ChunkHeader*>
// modify the matrix
dataDestination
->
m4x4Translation
.
scale
(
tmp_scale
[
0
],
tmp_scale
[
1
],
tmp_scale
[
2
]);
dataDestination
->
m4x4Translation
.
rotate
(
QQuaternion
(
tmp_rotation
[
3
],
tmp_rotation
[
0
],
tmp_rotation
[
1
],
tmp_rotation
[
2
]));
dataDestination
->
m4x4Translation
.
translate
(
tmp_trans
[
0
],
tmp_trans
[
1
],
tmp_trans
[
2
]);
dataDestination
->
quadRotation
.
setVector
(
QVector3D
(
tmp_rotation
[
0
],
tmp_rotation
[
1
],
tmp_rotation
[
2
]));
dataDestination
->
quadRotation
.
setScalar
(
tmp_rotation
[
3
]);
dataDestination
->
m4x4Translation
=
getParentMatrix
(
dataDestination
->
parent
)
*
dataDestination
->
m4x4Translation
;
...
...
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