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
87d5c28e
Commit
87d5c28e
authored
Aug 29, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method for turning patches into triangles
parent
72a399a4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
subdivision.cpp
QTProject/subdivision.cpp
+13
-0
subdivision.h
QTProject/subdivision.h
+1
-0
No files found.
QTProject/subdivision.cpp
View file @
87d5c28e
...
@@ -489,6 +489,19 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
...
@@ -489,6 +489,19 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
}
/**
/**
* Turns a patch index buffer into an index buffer of triangles.
*/
QVector
<
unsigned
int
>
Subdivision
::
getTriangles
(
QVector
<
unsigned
int
>
ib
)
{
QVector
<
unsigned
int
>
new_ib
;
for
(
int
i
=
0
;
i
<
ib
.
length
();
i
+=
12
)
{
new_ib
.
push_back
(
ib
[
i
+
3
]);
new_ib
.
push_back
(
ib
[
i
+
6
]);
new_ib
.
push_back
(
ib
[
i
+
7
]);
}
return
new_ib
;
}
/**
* Generates index buffers containing all regular and all irregular triangles in the input index buffer.
* Generates index buffers containing all regular and all irregular triangles in the input index buffer.
*
*
* @param index_buffer Index buffer describing triangles.
* @param index_buffer Index buffer describing triangles.
...
...
QTProject/subdivision.h
View file @
87d5c28e
...
@@ -62,6 +62,7 @@ private:
...
@@ -62,6 +62,7 @@ private:
//Geht davon aus, dass jeder 3D-Punkt nur einmal im Vertex-Buffer vorkommt!
//Geht davon aus, dass jeder 3D-Punkt nur einmal im Vertex-Buffer vorkommt!
QVector
<
unsigned
int
>
getPatchIndexBuffer
(
QVector
<
unsigned
int
>
ib
);
QVector
<
unsigned
int
>
getPatchIndexBuffer
(
QVector
<
unsigned
int
>
ib
);
QVector
<
unsigned
int
>
getTriangles
(
QVector
<
unsigned
int
>
ib
);
/**
/**
* @brief matchAndCompleteTriangle if tx ty matches sxsy, sysz or szsy, fill tz with third source vertex index.
* @brief matchAndCompleteTriangle if tx ty matches sxsy, sysz or szsy, fill tz with third source vertex index.
...
...
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