From 78739a666a7031db16648c7d629f567442ea16bd Mon Sep 17 00:00:00 2001 From: rodri Date: Thu, 26 Sep 2024 11:32:44 +0000 Subject: add an opacity parameter in OBJColor to discard non-colors. --- obj.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'obj.c') diff --git a/obj.c b/obj.c index aa52515..95fa11f 100644 --- a/obj.c +++ b/obj.c @@ -425,6 +425,7 @@ objmtlparse(char *file) m->Ka.g = strtod(f[2], nil); m->Ka.b = strtod(f[3], nil); } + m->Ka.a = 1; }else if(strcmp(f[0], "Kd") == 0){ if(nf != 2 && nf != 4){ mterror("syntax error"); @@ -441,6 +442,7 @@ objmtlparse(char *file) m->Kd.g = strtod(f[2], nil); m->Kd.b = strtod(f[3], nil); } + m->Kd.a = 1; }else if(strcmp(f[0], "Ks") == 0){ if(nf != 2 && nf != 4){ mterror("syntax error"); @@ -457,6 +459,7 @@ objmtlparse(char *file) m->Ks.g = strtod(f[2], nil); m->Ks.b = strtod(f[3], nil); } + m->Ks.a = 1; }else if(strcmp(f[0], "Ke") == 0){ if(nf != 2 && nf != 4){ mterror("syntax error"); @@ -473,6 +476,7 @@ objmtlparse(char *file) m->Ke.g = strtod(f[2], nil); m->Ke.b = strtod(f[3], nil); } + m->Ke.a = 1; }else if(strcmp(f[0], "Ns") == 0){ if(nf != 2){ mterror("syntax error"); -- cgit v1.2.3