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
fc7941a8
Commit
fc7941a8
authored
8 years ago
by
Anakin
Browse files
Options
Downloads
Patches
Plain Diff
fixed rotation problem
parent
24d26cfd
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
QtMeshViewer/Header/FileInterface.h
+1
-0
1 addition, 0 deletions
QtMeshViewer/Header/FileInterface.h
QtMeshViewer/Source/GeometryEngine.cpp
+1
-0
1 addition, 0 deletions
QtMeshViewer/Source/GeometryEngine.cpp
QtMeshViewer/Source/MshFile.cpp
+2
-1
2 additions, 1 deletion
QtMeshViewer/Source/MshFile.cpp
with
4 additions
and
1 deletion
QtMeshViewer/Header/FileInterface.h
+
1
−
0
View file @
fc7941a8
...
...
@@ -30,6 +30,7 @@ struct Model {
std
::
string
name
=
""
;
std
::
string
parent
=
""
;
QMatrix4x4
m4x4Translation
;
QQuaternion
quadRotation
;
std
::
vector
<
Segment
*>
segmList
;
};
...
...
This diff is collapsed.
Click to expand it.
QtMeshViewer/Source/GeometryEngine.cpp
+
1
−
0
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
)
...
...
This diff is collapsed.
Click to expand it.
QtMeshViewer/Source/MshFile.cpp
+
2
−
1
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
;
...
...
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