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
d24f3690
Commit
d24f3690
authored
Sep 01, 2016
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patchRender' of…
Merge branch 'patchRender' of
ssh://git.breab.org:2223/kai/Unterteilungsalgorithmen
into patchRender
parents
1de39cde
39d315af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
49 deletions
+119
-49
subdivision.cpp
QTProject/subdivision.cpp
+82
-38
subdivision.h
QTProject/subdivision.h
+31
-11
vertex.h
QTProject/vertex.h
+6
-0
No files found.
QTProject/subdivision.cpp
View file @
d24f3690
This diff is collapsed.
Click to expand it.
QTProject/subdivision.h
View file @
d24f3690
...
...
@@ -32,7 +32,7 @@ private:
QVector
<
GLuint
>
vertex_indices
;
QVector
<
GLuint
>
vertex_offsets
;
QVector
<
GLuint
>
index_buffer
;
QVector
<
GLuint
>
index_regular
;
QVector
<
GLuint
>
patch_
index_regular
;
};
struct
Result
...
...
@@ -60,21 +60,41 @@ private:
void
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
);
void
runEdgeShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
edge_indices_handle
,
GLuint
output_handle
,
GLuint
offset
);
//Geht davon aus, dass jeder 3D-Punkt nur einmal im Vertex-Buffer vorkommt!
QVector
<
unsigned
int
>
getPatchIndexBuffer
(
QVector
<
unsigned
int
>
ib
);
QVector
<
unsigned
int
>
getTriangles
(
QVector
<
unsigned
int
>
ib
);
QVector
<
unsigned
int
>
getPatchIndexBuffer
(
QVector
<
unsigned
int
>
ib_regular
,
QVector
<
unsigned
int
>
ib_irregular
,
QVector
<
Vertex
>
vb
);
/**
* @brief matchAndCompleteTriangleIndices if Indices tx ty matches sxsy, sysz or szsy, fill tz with third source vertex index.
* @param sx source triangle: first vertex index
* @param sy source triangle: second vertex index
* @param sz source triangle: third vertex index
* @param tx target triangle: first known vertex index
* @param ty target triangle: second known vertex index
* @param tz target triangle: unknown vertex index.
* @return true if triangles could be matched and tz was filled.
* Only use this method if you are absolutely sure that each vertex position appears ONLY ONCE in the vertex buffer!!
* No duplicate vertices with different normals or crap like that!
*/
bool
matchAndCompleteTriangleIndices
(
unsigned
int
sx
,
unsigned
int
sy
,
unsigned
int
sz
,
unsigned
int
tx
,
unsigned
int
ty
,
unsigned
int
&
tz
);
//same as matchandcomplete. doesn't rely on only one index per vertex location
//needs indices to fill tz
/**
* @brief matchAndCompleteTriangle if tx ty matches sxsy, sysz or szsy, fill tz with third source vertex index.
* @param sx source triangle: first vertex
* @param sy source triangle: second vertex
* @param sz source triangle: third vertex
* @param tx target triangle: first known vertex
* @param ty target triangle: second known vertex
* @param tz target triangle: unknown vertex.
* @brief matchAndCompleteTriangle if vertices at indices tx ty matches vertices at indices sxsy, sysz or szsy,
* fill tz with third source vertex index.
* @param sx source triangle: first vertex index
* @param sy source triangle: second vertex index
* @param sz source triangle: third vertex index
* @param tx target triangle: first known vertex index
* @param ty target triangle: second known vertex index
* @param tz target triangle: unknown vertex index.
* @param vb Vertex Buffer. This method compares the actual positions of the vertices
* @return true if triangles could be matched and tz was filled.
*/
bool
matchAndCompleteTriangle
(
unsigned
int
sx
,
unsigned
int
sy
,
unsigned
int
sz
,
unsigned
int
tx
,
unsigned
int
ty
,
unsigned
int
&
tz
);
bool
matchAndCompleteTriangle
(
unsigned
int
sx
,
unsigned
int
sy
,
unsigned
int
sz
,
unsigned
int
tx
,
unsigned
int
ty
,
unsigned
int
&
tz
,
QVector
<
Vertex
>
vb
);
};
#endif
QTProject/vertex.h
View file @
d24f3690
...
...
@@ -21,6 +21,12 @@ struct Vertex
Vertex
(
const
QVector3D
&
pos
,
const
QVector3D
&
normal
,
const
QVector2D
&
tex
);
bool
samePos
(
const
Vertex
&
other
)
const
;
bool
operator
==
(
const
Vertex
&
other
)
const
{
return
samePos
(
other
);
}
};
#pragma pack(pop)
...
...
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