Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
Unterteilungsalgorithmen
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
Unterteilungsalgorithmen
Commits
77ce866a
Commit
77ce866a
authored
Jul 07, 2016
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ui
parent
bf238c0c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
mesh.cpp
QTProject/mesh.cpp
+6
-10
mesh.h
QTProject/mesh.h
+3
-3
No files found.
QTProject/mesh.cpp
View file @
77ce866a
...
...
@@ -48,10 +48,6 @@ void Mesh::MeshEntry::init(QOpenGLFunctions_4_3_Core *f,QVector<Vertex>& Vertice
}
void
Mesh
::
MeshEntry
::
update
(
GLuint
VB
,
QVector
<
Vertex
>&
Vertices
,
QVector
<
unsigned
int
>&
Indices
){
numIndex
=
Indices
.
size
();
indices
=
Indices
;
vertices
=
Vertices
;
...
...
@@ -370,7 +366,7 @@ void Mesh::initMeshEntry(int index, aiMesh * entry){
}
void
Mesh
::
render
(
QOpenGLShaderProgram
*
shader
,
QMatrix4x4
V
,
QMatrix4x4
P
){
void
Mesh
::
render
(
QOpenGLShaderProgram
*
shader
,
QMatrix4x4
V
,
QMatrix4x4
P
,
int
subdivision
){
if
(
!
loaded
)
return
;
if
(
f
==
NULL
){
...
...
@@ -382,7 +378,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P){
f
->
glEnableVertexAttribArray
(
normalIndex
);
f
->
glEnableVertexAttribArray
(
uvIndex
);
renderNode
(
shader
,
rootNode
,
V
*
screenTransform
,
P
,
QMatrix4x4
());
renderNode
(
shader
,
rootNode
,
V
*
screenTransform
,
P
,
QMatrix4x4
()
,
subdivision
);
f
->
glDisableVertexAttribArray
(
positionIndex
);
f
->
glDisableVertexAttribArray
(
normalIndex
);
...
...
@@ -392,7 +388,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P){
}
void
Mesh
::
renderNode
(
QOpenGLShaderProgram
*
shader
,
Node
&
node
,
QMatrix4x4
V
,
QMatrix4x4
P
,
QMatrix4x4
M
){
void
Mesh
::
renderNode
(
QOpenGLShaderProgram
*
shader
,
Node
&
node
,
QMatrix4x4
V
,
QMatrix4x4
P
,
QMatrix4x4
M
,
int
subdivision
){
M
*=
node
.
transformation
;
QMatrix4x4
MV
=
V
*
M
;
...
...
@@ -406,15 +402,15 @@ void Mesh::renderNode(QOpenGLShaderProgram *shader, Node &node, QMatrix4x4 V,QMa
for
(
int
i
=
0
;
i
<
node
.
meshes
.
size
()
;
i
++
)
{
int
index
=
node
.
meshes
[
i
];
//load Material
renderMesh
(
shader
,
index
);
renderMesh
(
shader
,
index
,
subdivision
);
}
for
(
int
i
=
0
;
i
<
node
.
children
.
size
()
;
i
++
)
{
renderNode
(
shader
,
node
.
children
[
i
],
V
,
P
,
M
);
renderNode
(
shader
,
node
.
children
[
i
],
V
,
P
,
M
,
subdivision
);
}
}
void
Mesh
::
renderMesh
(
QOpenGLShaderProgram
*
shader
,
int
index
)
void
Mesh
::
renderMesh
(
QOpenGLShaderProgram
*
shader
,
int
index
,
int
subdivision
)
{
int
MaterialIndex
=
entries
[
index
].
materialIndex
;
if
(
MaterialIndex
<
materials
.
size
())
{
...
...
QTProject/mesh.h
View file @
77ce866a
...
...
@@ -51,7 +51,7 @@ public:
Mesh
(
QOpenGLFunctions_4_3_Core
*
f
,
Mesh
*
mesh
,
QVector
<
Vertex
>
&
vertex_buffer
,
QVector
<
GLuint
>
&
index_buffer
);
~
Mesh
();
void
render
(
QOpenGLShaderProgram
*
shader
,
QMatrix4x4
V
,
QMatrix4x4
P
);
void
render
(
QOpenGLShaderProgram
*
shader
,
QMatrix4x4
V
,
QMatrix4x4
P
,
int
subdivision
);
const
aiScene
*
scene
;
bool
debug
=
true
;
...
...
@@ -127,8 +127,8 @@ private:
void
initNode
(
const
aiScene
*
scene
,
aiNode
*
node
,
Node
&
newNode
,
QString
debugoffset
);
void
renderNode
(
QOpenGLShaderProgram
*
shader
,
Node
&
node
,
QMatrix4x4
V
,
QMatrix4x4
P
,
QMatrix4x4
M
);
void
renderMesh
(
QOpenGLShaderProgram
*
shader
,
int
index
);
void
renderNode
(
QOpenGLShaderProgram
*
shader
,
Node
&
node
,
QMatrix4x4
V
,
QMatrix4x4
P
,
QMatrix4x4
M
,
int
subdivision
);
void
renderMesh
(
QOpenGLShaderProgram
*
shader
,
int
index
,
int
subdivision
);
void
findObjectDimension
(
Node
node
,
QMatrix4x4
transform
,
QVector3D
&
min
,
QVector3D
&
max
);
...
...
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