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
7e87b14f
Commit
7e87b14f
authored
Apr 30, 2017
by
Anakin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made all path relative now
parent
da0b7e3c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
102 additions
and
12 deletions
+102
-12
QtMeshViewer/Form Files/MainWindow.ui
QtMeshViewer/Form Files/MainWindow.ui
+69
-1
QtMeshViewer/Header/MainWindow.h
QtMeshViewer/Header/MainWindow.h
+2
-0
QtMeshViewer/Resources/fshader.glsl
QtMeshViewer/Resources/fshader.glsl
+0
-1
QtMeshViewer/Resources/vshader.glsl
QtMeshViewer/Resources/vshader.glsl
+0
-1
QtMeshViewer/Source/MainWindow.cpp
QtMeshViewer/Source/MainWindow.cpp
+29
-0
QtMeshViewer/Source/MshFile.cpp
QtMeshViewer/Source/MshFile.cpp
+1
-2
README.md
README.md
+1
-7
Release/QtMeshViewer.exe
Release/QtMeshViewer.exe
+0
-0
No files found.
QtMeshViewer/Form Files/MainWindow.ui
View file @
7e87b14f
...
...
@@ -19,7 +19,9 @@
<property
name=
"windowTitle"
>
<string>
MainWindow
</string>
</property>
<widget
class=
"QWidget"
name=
"centralWidget"
/>
<widget
class=
"QWidget"
name=
"centralWidget"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
/>
</widget>
<widget
class=
"QToolBar"
name=
"mainToolBar"
>
<property
name=
"allowedAreas"
>
<set>
Qt::LeftToolBarArea|Qt::RightToolBarArea|Qt::TopToolBarArea
</set>
...
...
@@ -32,6 +34,72 @@
</attribute>
</widget>
<widget
class=
"QStatusBar"
name=
"statusBar"
/>
<widget
class=
"QDockWidget"
name=
"dockWidget"
>
<property
name=
"autoFillBackground"
>
<bool>
false
</bool>
</property>
<property
name=
"features"
>
<set>
QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetFloatable
</set>
</property>
<property
name=
"allowedAreas"
>
<set>
Qt::RightDockWidgetArea
</set>
</property>
<property
name=
"windowTitle"
>
<string>
Asset library
</string>
</property>
<attribute
name=
"dockWidgetArea"
>
<number>
2
</number>
</attribute>
<widget
class=
"QWidget"
name=
"dockWidgetContents"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
0
</number>
</property>
<property
name=
"rightMargin"
>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<item>
<widget
class=
"QTreeWidget"
name=
"treeWidget"
>
<property
name=
"showDropIndicator"
stdset=
"0"
>
<bool>
false
</bool>
</property>
<property
name=
"dragEnabled"
>
<bool>
true
</bool>
</property>
<property
name=
"dragDropMode"
>
<enum>
QAbstractItemView::DragOnly
</enum>
</property>
<property
name=
"selectionBehavior"
>
<enum>
QAbstractItemView::SelectItems
</enum>
</property>
<property
name=
"verticalScrollMode"
>
<enum>
QAbstractItemView::ScrollPerPixel
</enum>
</property>
<property
name=
"headerHidden"
>
<bool>
true
</bool>
</property>
<property
name=
"expandsOnDoubleClick"
>
<bool>
false
</bool>
</property>
<column>
<property
name=
"text"
>
<string
notr=
"true"
>
1
</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
<resources>
...
...
QtMeshViewer/Header/MainWindow.h
View file @
7e87b14f
...
...
@@ -30,6 +30,8 @@ private:
// functions
private:
void
setupWidgets
();
void
getAssetLibrary
();
void
searchMeshFiles
(
QString
path
);
void
openFile
();
void
takeScreenShot
();
void
aboutTool
();
...
...
QtMeshViewer/Resources/fshader.glsl
View file @
7e87b14f
#version 450
#ifdef GL_ES
// Set default precision to medium
precision
mediump
int
;
...
...
QtMeshViewer/Resources/vshader.glsl
View file @
7e87b14f
#version 450
#ifdef GL_ES
// Set default precision to medium
precision
mediump
int
;
...
...
QtMeshViewer/Source/MainWindow.cpp
View file @
7e87b14f
...
...
@@ -49,6 +49,8 @@ MainWindow::MainWindow(QWidget *parent)
styleSheet
.
open
(
QIODevice
::
ReadOnly
);
this
->
setStyleSheet
(
styleSheet
.
readAll
());
getAssetLibrary
();
printMessage
(
"MeshViewer by Anakin"
,
0
);
}
...
...
@@ -161,6 +163,33 @@ void MainWindow::setupWidgets()
}
void
MainWindow
::
getAssetLibrary
()
{
QTreeWidgetItem
*
item
=
new
QTreeWidgetItem
;
item
->
setData
(
0
,
Qt
::
DisplayRole
,
"Wuhu"
);
ui
->
treeWidget
->
addTopLevelItem
(
item
);
searchMeshFiles
(
"D:/workspaces/Visual Studio 2015/Projects/OpenGL/Release"
);
}
void
MainWindow
::
searchMeshFiles
(
QString
path
)
{
QDir
directory
(
path
);
directory
.
setNameFilters
(
QStringList
(
"*.msh"
));
QStringList
childDirectories
=
directory
.
entryList
(
QDir
::
AllDirs
|
QDir
::
NoDotAndDotDot
);
QStringList
fileNames
=
directory
.
entryList
(
QDir
::
Files
);
for
(
auto
&
it
:
childDirectories
)
qDebug
()
<<
it
;
for
(
auto
&
it
:
fileNames
)
qDebug
()
<<
it
;
}
void
MainWindow
::
openFile
()
{
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
"Open File"
,
""
,
"Mesh (*.msh)"
);
...
...
QtMeshViewer/Source/MshFile.cpp
View file @
7e87b14f
...
...
@@ -707,7 +707,6 @@ void MshFile::analyseSegmChunks(Model * dataDestination, QList<ChunkHeader*>& ch
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
//TODO: buffer size == 1; k = 2;
// polygon normal wasn't calculated before
if
(
new_segment
->
vertices
[
tmp_buffer
[
k
]].
polygonNormal
==
QVector3D
(
0
,
0
,
0
))
{
...
...
@@ -921,7 +920,7 @@ void MshFile::loadTexture(QOpenGLTexture *& destination, QString filepath, QStri
if
(
!
loadSuccess
)
{
OutputDevice
::
getInstance
()
->
print
(
"WARNING: texture not found or corrupted: "
+
filename
,
1
);
//TODO:
use the correct diffuse color or return with
null
//TODO:
cloth use the wrong diffuse color. should be
null
img
=
QImage
(
1
,
1
,
QImage
::
Format_RGB32
);
img
.
fill
(
QColor
(
m_materials
->
back
().
diffuseColor
[
0
]
*
255
,
m_materials
->
back
().
diffuseColor
[
1
]
*
255
,
m_materials
->
back
().
diffuseColor
[
2
]
*
255
));
filename
+=
" *"
;
...
...
README.md
View file @
7e87b14f
...
...
@@ -12,10 +12,4 @@ So far it is just me. If you wanna help me, let me know :D
Feel free to use my code the way you like. But remember i used some public libraries. Make sure you read their
licence, too.
### To Do
-
normal map,
-
list all msh in a directory
-
glow/emissive
-
optional display bones, shadow, collision
-
change pose
-
animation
Release/QtMeshViewer.exe
View file @
7e87b14f
No preview for this file type
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