DEF dice=STRUCT:<
face1 TEXTURE SIMPLETEXTURE:'img/dice_3.png',
face2 TEXTURE SIMPLETEXTURE:'img/dice_4.png',
face3 TEXTURE SIMPLETEXTURE:'img/dice_2.png',
face4 TEXTURE SIMPLETEXTURE:'img/dice_5.png',
face5 TEXTURE SIMPLETEXTURE:'img/dice_1.png',
face6 TEXTURE SIMPLETEXTURE:'img/dice_6.png'>
WHERE
face1 = (S1:cubo),
face2 = (S2:cubo),
face3 = (S3:cubo),
face4 = (S4:cubo),
face5 = (S5:cubo),
face6 = (S6:cubo),
cubo = extract_polygons:(cuboid:<1,1,1>)
END;
DEF axis_cameras(pol::K:True) = INSL:CAMERA:(cat:<<pol>,camera_list>)
WHERE camera_list=(AA:BaseCamera):(REVERSE:(TRANS:camera_param_list)),
camera_param_list=<positions,orientations,fieldOfViews,descriptions>,
positions= < <maxx + 1.25*maxlyz/(PI/4), medy, medz>,
<minx - 1.25*maxlyz/(PI/4), medy, medz>,
<medx, maxy + 1.25*maxlxz/(PI/4), medz>,
<medx, miny - 1.25*maxlxz/(PI/4), medz>,
<medx, medy, maxz + 1.25*maxlxy/(PI/4)>,
<medx, medy, minz - 1.25*maxlxy/(PI/4)>>,
orientations=<<0,1,0,PI/2>,<0,-1,0,PI/2>,
<-1,0,0,PI/2>,<1,0,0,PI/2>,
<0,0,1,0>,<0,1,0,PI>>,
fieldofviews=##:6:<(PI/4)>,
descriptions=<'x_positive' , 'x_negative',
'y_positive' , 'y_negative',
'z_positive' , 'z_negative'>,
maxx=MAX:1:pol, maxy=MAX:2:pol, maxz=MAX:3:pol,
minx=MIN:1:pol, miny=MIN:2:pol, minz=MIN:3:pol,
lenx=maxx-minx, leny=maxy-miny, lenz=maxz-minz,
medx=MED:1:pol, medy=MED:2:pol, medz=MED:3:pol,
maxlxy=(if:<k:(LE:lenx:leny),k:lenx,k:leny>:0),
maxlyz=(if:<k:(LE:leny:lenz),k:leny,k:lenz>:0),
maxlxz=(if:<k:(LE:lenx:lenz),k:lenx,k:lenz>:0)
END;
def out=axis_cameras:dice;