Commit 307cb8a3 by Alisa Jung

added documentation for patch index buffer computation

parent 1e6ec30f
...@@ -362,6 +362,22 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -362,6 +362,22 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
return tables; return tables;
} }
/**
* @brief Subdivision::getPatchIndexBuffer
* Computes an index buffer for the patches. patches are in order from figure 6(a) from the paper:
* 0 1
*
* 2 3 4
*
* 5 6 7 8
*
* 9 10 11
*
* with 367 being the original triangle.
* Assumes that each vertex \exists only once in the vertex buffer, i.e. with regular patches, each index in the index buffer \exists 6 times.
* @param ib original index buffer
* @return patch index buffer with 4 times as many indices. ! if something goes wrong, the current buffer is returned and might be incomplete or empty.
*/
QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib){ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib){
QVector<unsigned int> pib; QVector<unsigned int> pib;
for (int i = 0; i < ib.length() - 2; i+=3){ for (int i = 0; i < ib.length() - 2; i+=3){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment