Commit 4f193052 by Philipp Adolf

Fix indices in index buffer

parent 84b5aebf
...@@ -221,20 +221,20 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -221,20 +221,20 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
//add indices to new index buffer //add indices to new index buffer
tables.index_buffer.push_back(ib[i]); tables.index_buffer.push_back(ib[i]);
tables.index_buffer.push_back(nib_offset + 3*i); tables.index_buffer.push_back(nib_offset + i);
tables.index_buffer.push_back(nib_offset + 3*i + 2); tables.index_buffer.push_back(nib_offset + i + 2);
tables.index_buffer.push_back(ib[i+1]); tables.index_buffer.push_back(ib[i+1]);
tables.index_buffer.push_back(nib_offset + 3*i + 1); tables.index_buffer.push_back(nib_offset + i + 1);
tables.index_buffer.push_back(nib_offset + 3*i); tables.index_buffer.push_back(nib_offset + i);
tables.index_buffer.push_back(ib[i+2]); tables.index_buffer.push_back(ib[i+2]);
tables.index_buffer.push_back(nib_offset + 3*i + 2); tables.index_buffer.push_back(nib_offset + i + 2);
tables.index_buffer.push_back(nib_offset + 3*i + 1); tables.index_buffer.push_back(nib_offset + i + 1);
tables.index_buffer.push_back(nib_offset + 3*i); tables.index_buffer.push_back(nib_offset + i);
tables.index_buffer.push_back(nib_offset + 3*i + 1); tables.index_buffer.push_back(nib_offset + i + 1);
tables.index_buffer.push_back(nib_offset + 3*i + 2); tables.index_buffer.push_back(nib_offset + i + 2);
//Wichtig: Wir gehen davon aus, dass wir geschlossene Oberflächen haben, dh für jede Kante von einem Dreieck wird eine passende Kante bei einem anderen Dreieck gefunden. //Wichtig: Wir gehen davon aus, dass wir geschlossene Oberflächen haben, dh für jede Kante von einem Dreieck wird eine passende Kante bei einem anderen Dreieck gefunden.
}//for each index in indexbuffer }//for each index in indexbuffer
......
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