Archived post by Atom

Yon recently posted a link to a .rar file with example models for destruction practice. A few of them contained a bunch of related texture maps referenced by a .mtl file.
I wrote a short script that will read the .mtl file and create a Redshift material with a *rsTextureMap* populated with the associated map for that material. It is a quick way to get a bunch of materials generated that are related to the model.
You can check it out at this link if you are a Redshift user. forums.odforce.net/topic/32900-mtl-to-redshift-material/

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20184702/26/18/untitled-1.jpg

Archived post by dchow

“`int pp0[] = primpoints(0, 0);
vector prpos = prim(0, “P”, 0);
vector pos0 = point(0, “P”, pp0[0]); vector pos1 = point(0, “P”, pp0[1]); vector pos2 = point(0, “P”, pp0[-1]);
vector v0 = normalize(pos2-pos0); vector v1 = normalize(pos1-pos0); vector v2 = normalize(cross(v0,v1)); v1 = normalize(cross(v2,v0));
matrix x0 = maketransform(v1, v2, prpos);
pp0 = primpoints(1, 0);
prpos = prim(1, “P”, 0);
pos0 = point(1, “P”, pp0[0]); pos1 = point(1, “P”, pp0[1]); pos2 = point(1, “P”, pp0[-1]);
v0 = normalize(pos2-pos0); v1 = normalize(pos1-pos0); v2 = normalize(cross(v0,v1)); v1 = normalize(cross(v2,v0));
matrix x1 = maketransform(v1, v2, prpos);
matrix output = invert(x0)*x1; @P *= output; “`

i think it’s that