diff options
author | rodri <rgl@antares-labs.eu> | 2024-07-13 15:38:51 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-07-13 15:38:51 +0000 |
commit | 4966f25444d343ade4a6fbdd29f6175f372da09d (patch) | |
tree | bafce14916a462f155c17040cf0e3a5d085bae18 | |
parent | 310042a543077ffc1f2325c75e99a5e772b908ff (diff) | |
download | 3dee-4966f25444d343ade4a6fbdd29f6175f372da09d.tar.gz 3dee-4966f25444d343ade4a6fbdd29f6175f372da09d.tar.bz2 3dee-4966f25444d343ade4a6fbdd29f6175f372da09d.zip |
vis: add knobs to control culling.
-rw-r--r-- | vis.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -600,15 +600,27 @@ mmb(void) { enum { MOVELIGHT, + SP0, TSNEAREST, TSBILINEAR, + SP1, SHOWNORMALS, + SP2, + CULLFRONT, + CULLBACK, + CULLNO, }; static char *items[] = { [MOVELIGHT] "move light", + "", [TSNEAREST] "use nearest sampler", [TSBILINEAR] "use bilinear sampler", + "", [SHOWNORMALS] "show normals", + "", + [CULLFRONT] "cull front faces", + [CULLBACK] "cull back faces", + [CULLNO] "no culling", nil, }; static Menu menu = { .item = items }; @@ -637,6 +649,15 @@ mmb(void) case SHOWNORMALS: shownormals ^= 1; break; + case CULLFRONT: + maincam->cullmode = CullFront; + break; + case CULLBACK: + maincam->cullmode = CullBack; + break; + case CULLNO: + maincam->cullmode = CullNone; + break; } unlockdisplay(display); nbsend(drawc, nil); |