/* * FILE: polygon3_6.dat * * example for automatic normal generation for textured polygons */ A1 = (0.,0.,0.); B1 = (10.,0.,0.); C1 = (10.,10.,5.); D1 = (0.,10.,5.); TA1 = (0.,0.); TB1 = (1.,0.); TC1 = (1.,1.); TD1 = (0.,1.); A2 = D1; B2 = C1; C2 = (10.,20.,0.); D2 = (0.,20.,0.); cont1 = ((A1,TA1),(B1,TB1),(C1,TC1),(D1,TD1)); polygon1 = POLYGON3T( (A1,B1,D1), (cont1) ); cont2 = ((A2,TA1),(B2,TB1),(C2,TC1),(D2,TD1)); polygon2 = POLYGON3T( (A2,B2,D2), (cont2) ); polygroup1 = (polygon1,polygon2); node1 = SCENENODE ( (), (), polygroup1 ); func1 = CALCNORMALS( (polygroup1) ); node2 = SCENENODE( (), (TRANSFORMS( TRNSF3PT((15,0,0),(16,0,0),(15,1,0)) )), [func1] ); teximg1 = TEXIMAGE2D( ( ((1,0,0,1), (0,1,0,1)), ((0,0,1,1), (1,1,0,1)) ) ); SCENEROOT = SCENENODE( (node1,node2), (ATTRIBS( teximg1, USETEXIMG(2), USETEXWRAPX(1), USETEXWRAPY(1), USETEXMAGTONEAREST(1), USETEXMINTONEAREST(1)) ), () );