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
9b3d12df
Commit
9b3d12df
authored
Dec 02, 2016
by
Anakin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scale everything to 1,
cloth not displayed completely, corvette is not displayed why?
parent
a47eefe9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
MshViewer/Header/OpenGLController.h
MshViewer/Header/OpenGLController.h
+1
-1
MshViewer/Source/OpenGlController.cpp
MshViewer/Source/OpenGlController.cpp
+7
-1
MshViewer/main.cpp
MshViewer/main.cpp
+1
-1
No files found.
MshViewer/Header/OpenGLController.h
View file @
9b3d12df
...
...
@@ -81,7 +81,7 @@ private:
float
fRotationZ
=
0
;
double
dTranslationX
=
0
;
double
dTranslationY
=
0
;
double
dTranslationZ
=
5
;
double
dTranslationZ
=
3
;
// ========================================
...
...
MshViewer/Source/OpenGlController.cpp
View file @
9b3d12df
...
...
@@ -243,13 +243,19 @@ glm::mat4 OpenGLController::getMVPMatrix(unsigned int index)
m4x4ModelRot
=
glm
::
rotate
(
m4x4ModelRot
,
fRotationY
,
glm
::
vec3
(
0
,
1
,
0
));
m4x4ModelRot
=
glm
::
rotate
(
m4x4ModelRot
,
fRotationZ
,
glm
::
vec3
(
0
,
0
,
1
));
// move to center
glm
::
mat4
m4x4ModelCenter
=
glm
::
translate
(
glm
::
mat4
(
1.0
f
),
glm
::
vec3
(
-
sceneBoundingBox
.
center
[
0
],
-
sceneBoundingBox
.
center
[
1
],
-
sceneBoundingBox
.
center
[
2
])
);
//scale to 1
float
maxExtent
=
max
(
max
(
sceneBoundingBox
.
extents
[
0
],
sceneBoundingBox
.
extents
[
1
]),
sceneBoundingBox
.
extents
[
2
]);
glm
::
mat4
m4x4Normalize
=
glm
::
mat4
(
1.0
f
);
m4x4Normalize
=
glm
::
scale
(
m4x4Normalize
,
glm
::
vec3
(
1
/
maxExtent
,
1
/
maxExtent
,
1
/
maxExtent
));
// Return MVP
return
m4x4Projection
*
m4x4View
*
m4x4ModelRot
*
m4x4ModelCenter
*
getModelMatrix
(
index
);
return
m4x4Projection
*
m4x4View
*
m4x4ModelRot
*
m4x4
Normalize
*
m4x4
ModelCenter
*
getModelMatrix
(
index
);
}
...
...
MshViewer/main.cpp
View file @
9b3d12df
...
...
@@ -17,7 +17,7 @@ int main(int argc, char** argv)
else
scene
=
OpenGLController
::
getInstance
();
scene
->
loadMsh
(
"..
\\
Release
\\
Msh
\\
multiModTex
.msh"
);
scene
->
loadMsh
(
"..
\\
Release
\\
Msh
\\
quadPoly
.msh"
);
do
{
scene
->
updateScene
();
...
...
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