From 5e67aeb2c8fc89734f38fe67b1bf499e11cc5fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 8 Jun 2019 16:00:08 +0200 Subject: [PATCH] Add triangle mode --- programs/modelViewer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/programs/modelViewer.c b/programs/modelViewer.c index 221e080..4c2ca93 100644 --- a/programs/modelViewer.c +++ b/programs/modelViewer.c @@ -305,6 +305,13 @@ void drawPixel(S3L_PixelInfo *p) b = p->barycentric[2] >> 1; break; } + + case 5: // triangle index mode + { + r = S3L_min(p->triangleIndex,255); + g = r; + b = r; + } default: break; @@ -518,6 +525,8 @@ int main() mode = 3; else if (state[SDL_SCANCODE_KP_4]) mode = 4; + else if (state[SDL_SCANCODE_KP_5]) + mode = 5; if (modelIndex == 2) animate(((double) clock()) / CLOCKS_PER_SEC);