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
9ead25f6
Commit
9ead25f6
authored
Sep 01, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consider regular triangles for vertex table
parent
4093abb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
subdivision.cpp
QTProject/subdivision.cpp
+11
-10
subdivision.h
QTProject/subdivision.h
+1
-1
No files found.
QTProject/subdivision.cpp
View file @
9ead25f6
...
...
@@ -157,7 +157,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
}
precomputeEdgeTable
(
tables
,
triangles
,
triangles_regular
,
(
unsigned
int
)
vb
.
length
());
precomputeVertexTable
(
tables
,
vb
,
ib
);
precomputeVertexTable
(
tables
,
vb
,
ib
,
ib_regular
);
//tables.patch_index_regular = getPatchIndexBuffer(ib, QVector<unsigned int>());//TODO pass regular and irregular index buffer?
qCDebug
(
log_subdiv
)
<<
"Precompute Tables Done"
;
...
...
@@ -286,10 +286,11 @@ void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Trian
}
}
void
Subdivision
::
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Vertex
>
&
vb
,
QVector
<
unsigned
int
>
&
ib
)
{
void
Subdivision
::
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Vertex
>
&
vb
,
QVector
<
unsigned
int
>
&
ib
,
QVector
<
unsigned
int
>
&
ib_regular
)
{
//compute vertex table
//Format: First entry: original vertex. Other entries: adjacent vertices.
QVector
<
QVector
<
unsigned
int
>
>
duplicates
;
//for debugging
QVector
<
unsigned
int
>
ib_combined
=
ib
+
ib_regular
;
unsigned
int
offset
=
0
;
for
(
int
i
=
0
;
i
<
vb
.
length
();
i
++
){
//hat evtl viel redundanz
...
...
@@ -303,21 +304,21 @@ void Subdivision::precomputeVertexTable(Subdivision::Tables &tables, QVector<Ver
QVector
<
unsigned
int
>
d
;
for
(
int
j
=
0
;
j
<
ib
.
length
();
j
++
){
for
(
int
j
=
0
;
j
<
ib
_combined
.
length
();
j
++
){
//suche verweise auf vertex im indexbuffer
if
(
vb
[
ib
[
j
]].
samePos
(
originalVertex
)){
if
(
vb
[
ib
_combined
[
j
]].
samePos
(
originalVertex
)){
d
.
push_back
(
j
);
unsigned
int
i1
,
i2
;
//indices for neighbour vertices
if
(
j
%
3
==
0
){
i1
=
ib
[
j
+
1
];
i2
=
ib
[
j
+
2
];
i1
=
ib
_combined
[
j
+
1
];
i2
=
ib
_combined
[
j
+
2
];
}
else
if
(
j
%
3
==
1
){
i1
=
ib
[
j
-
1
];
i2
=
ib
[
j
+
1
];
i1
=
ib
_combined
[
j
-
1
];
i2
=
ib
_combined
[
j
+
1
];
}
else
{
i1
=
ib
[
j
-
2
];
i2
=
ib
[
j
-
1
];
i1
=
ib
_combined
[
j
-
2
];
i2
=
ib
_combined
[
j
-
1
];
}
Vertex
v1
,
v2
;
//neighbour vertices;
...
...
QTProject/subdivision.h
View file @
9ead25f6
...
...
@@ -55,7 +55,7 @@ private:
QOpenGLShaderProgram
*
initComputeShaderProgram
(
QString
&
source
);
Tables
precomputeTables
(
Input
input
);
void
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
QVector
<
Triangle
>
&
triangles_regular
,
unsigned
int
offset
);
void
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Vertex
>
&
vb
,
QVector
<
unsigned
int
>
&
ib
);
void
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Vertex
>
&
vb
,
QVector
<
unsigned
int
>
&
ib
,
QVector
<
unsigned
int
>
&
ib_regular
);
void
findRegular
(
QVector
<
unsigned
int
>
index_buffer
,
QVector
<
Vertex
>
vertex_buffer
,
QVector
<
unsigned
int
>
&
regular
,
QVector
<
unsigned
int
>
&
irregular
);
Result
runShader
(
Input
input
,
Tables
&
tables
);
void
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
);
...
...
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