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
d14dc5a6
Commit
d14dc5a6
authored
Aug 29, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add buffer of regular triangles to Input
parent
5579c275
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
subdivision.cpp
QTProject/subdivision.cpp
+9
-1
subdivision.h
QTProject/subdivision.h
+1
-0
No files found.
QTProject/subdivision.cpp
View file @
d14dc5a6
...
@@ -66,6 +66,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -66,6 +66,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
input
.
vb_handle
=
entry
->
VB_handle
;
input
.
vb_handle
=
entry
->
VB_handle
;
input
.
vertex_buffer
=
entry
->
vertices
;
input
.
vertex_buffer
=
entry
->
vertices
;
input
.
index_irregular_buffer
=
entry
->
indices_irregular
;
input
.
index_irregular_buffer
=
entry
->
indices_irregular
;
input
.
index_regular_buffer
=
getTriangles
(
entry
->
indices_regular
);
if
(
input
.
index_irregular_buffer
.
isEmpty
())
{
if
(
input
.
index_irregular_buffer
.
isEmpty
())
{
// current_mesh->update(input.vb_handle, input.vertex_buffer, input.index_buffer, entry->indices_regular);
// current_mesh->update(input.vb_handle, input.vertex_buffer, input.index_buffer, entry->indices_regular);
...
@@ -138,7 +139,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -138,7 +139,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
Tables
tables
;
Tables
tables
;
QVector
<
unsigned
int
>
ib
=
input
.
index_irregular_buffer
;
QVector
<
unsigned
int
>
ib
=
input
.
index_irregular_buffer
;
qCDebug
(
log_subdiv_trace
)
<<
"Index Buffer: "
<<
ib
;
qCDebug
(
log_subdiv_trace
)
<<
"Index Buffer Irregular: "
<<
ib
;
QVector
<
unsigned
int
>
ib_regular
=
input
.
index_regular_buffer
;
qCDebug
(
log_subdiv_trace
)
<<
"Index Buffer Regular: "
<<
ib_regular
;
QVector
<
Vertex
>
vb
=
input
.
vertex_buffer
;
QVector
<
Vertex
>
vb
=
input
.
vertex_buffer
;
qCDebug
(
log_subdiv_trace
)
<<
"Vertex Buffer: "
<<
vb
;
qCDebug
(
log_subdiv_trace
)
<<
"Vertex Buffer: "
<<
vb
;
...
@@ -147,6 +151,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -147,6 +151,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
for
(
int
i
=
0
;
i
<
ib
.
length
();
i
+=
3
)
{
for
(
int
i
=
0
;
i
<
ib
.
length
();
i
+=
3
)
{
triangles
.
push_back
(
Triangle
(
vb
,
ib
[
i
],
ib
[
i
+
1
],
ib
[
i
+
2
]));
triangles
.
push_back
(
Triangle
(
vb
,
ib
[
i
],
ib
[
i
+
1
],
ib
[
i
+
2
]));
}
}
QVector
<
Triangle
>
triangles_regular
;
for
(
int
i
=
0
;
i
<
ib_regular
.
length
();
i
+=
3
)
{
triangles
.
push_back
(
Triangle
(
vb
,
ib_regular
[
i
],
ib_regular
[
i
+
1
],
ib_regular
[
i
+
2
]));
}
precomputeEdgeTable
(
tables
,
triangles
,
(
unsigned
int
)
vb
.
length
());
precomputeEdgeTable
(
tables
,
triangles
,
(
unsigned
int
)
vb
.
length
());
precomputeVertexTable
(
tables
,
vb
,
ib
);
precomputeVertexTable
(
tables
,
vb
,
ib
);
...
...
QTProject/subdivision.h
View file @
d14dc5a6
...
@@ -23,6 +23,7 @@ private:
...
@@ -23,6 +23,7 @@ private:
{
{
GLuint
vb_handle
;
GLuint
vb_handle
;
QVector
<
unsigned
int
>
index_irregular_buffer
;
QVector
<
unsigned
int
>
index_irregular_buffer
;
QVector
<
unsigned
int
>
index_regular_buffer
;
QVector
<
Vertex
>
vertex_buffer
;
QVector
<
Vertex
>
vertex_buffer
;
};
};
...
...
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