cgkitは面白い。
load("facetest.obj")
model=worldObject("obj1")
convertToTriMesh(model)
#model.geom.newVariable("matid", UNIFORM, INT)
m1=OBJMaterial( name = "mat1",
Ka = (0.6, 0.0, 0.0),
Kd = (0.8, 0.0, 0.0),
Ks = (0.0, 0.0, 0.0),
Ns = 5.0
)
m2=OBJMaterial( name = "mat2",
Ka = (0.0, 0.0, 0.6),
Kd = (0.0, 0.0, 0.8),
Ks = (0.0, 0.0, 0.0),
Ns = 5.0
)
m3=OBJMaterial( name = "mat3",
Ka = (0.6, 0.6, 0.0),
Kd = (0.8, 0.8, 0.0),
Ks = (0.0, 0.0, 0.0),
Ns = 5.0
)
model.material = [m1,m2,m3]
matids = model.geom.slot("matid")
i=0
for v in model.geom.slot("matid"):
matids[i] = v
i=i+1


ありがとうございます。
- -
- -