i tried this but also not work
fn drawDoor vertices =
(
thick=.25
face1=#()
face2=#()
face1Normal = normalize (cross (vertices[3] - vertices[2]) (vertices[1] - vertices[2]))
face2Normal=-face1Normal ;
face1[1]= (vertices[1]+ (thick*face1Normal))
face1[2]= vertices[2]+(thick*face1Normal)
face1[3]= vertices[3]+(thick*face1Normal)
face1[4]=vertices[4]+ (thick*face1Normal)
face2[1]= (vertices[1]+ (thick*face2Normal))
face2[2]= vertices[2]+(thick*face2Normal)
face2[3]= vertices[3]+(thick*face2Normal)
face2[4]=vertices[4]+ (thick*face2Normal)
obj = convertToPoly (mesh vertices:face1 faces:#())
polyOp.createPolygon obj #(1,2,3,4)
obj2 = convertToPoly (mesh vertices:face2 faces:#())
polyOp.createPolygon obj2 #(4,3,2,1)
img_path = "C:\Users\Abdo\Desktop/Door.jpg"
channel = 1;
num_faces = polyop.getNumFaces obj;
for f = 1 to num_faces do(
uvF = polyOp.getMapFace $ channel f;
polyOp.setMapVert obj channel uvF[1] [0,0,0];
polyOp.setMapVert obj channel uvF[2] [100,0,0];
polyOp.setMapVert obj channel uvF[3] [0,100,0];
polyOp.setMapVert obj channel uvF[4] [100,100,0];
)
mat=standardmaterial();
mat.diffuseMap = bitmapTexture filename:(img_path)
-- to display material on face
showtexturemap mat true
/*
uvw to adjust texture mapping
*/
polyop.applyUVWMap obj \
#face \
obj.material=mat
mat2=standardmaterial();
mat2.diffuseMap = bitmapTexture filename:(img_path)
-- to display material on face
showtexturemap mat2 true
/*
uvw to adjust texture mapping
*/
polyop.applyUVWMap obj2 \
#face \
obj2.material=mat2
)