################################################# # SLIDE Dynamic Diamonds Example for explaining # bounding boxes in the Preprocess, PreprocessGraph, # Update, and UpdateGraph phases of execution. # surface sBlue color ( 0 0 1 ) endsurface point pDiamondX ( 1 0 0 ) endpoint point pDiamondY ( 0 1 0 ) endpoint point pDiamondx ( -1 0 0 ) endpoint point pDiamondy ( 0 -1 0 ) endpoint face fDiamond ( pDiamondX pDiamondY pDiamondx pDiamondy ) endface object oDiamond ( fDiamond ) solid SLF_HOLLOW shading SLF_WIRE endobject point pMorphX ( {expr 1.5 - 0.5*cos(2.0*$SLF_TIME)} 0 0 ) endpoint point pMorphY ( 0 1 0 ) endpoint point pMorphx ( -1 0 0 ) endpoint point pMorphy ( 0 -1 0 ) endpoint face fMorph ( pMorphX pMorphY pMorphx pMorphy ) endface object oMorph ( fMorph ) solid SLF_HOLLOW shading SLF_WIRE endobject group g2Diamonds instance oDiamond id iLeft scale ( 0.4 0.4 1 ) translate ( -0.6 0 0 ) scale ( 1.4 1.4 1 ) endinstance instance oDiamond id iRight scale ( 0.4 0.4 1 ) translate ( 0.6 0 0 ) scale ( 1.4 1.4 1 ) endinstance instance Camera id iCamera translate ( 2 -2 {expr 0.15 - 0.05*cos(2.0*$SLF_TIME)} ) endinstance instance Light id iLight translate ( 2 -2 {expr 0.15 - 0.05*cos(2.0*$SLF_TIME)} ) endinstance endgroup group gTopRight instance g2Diamonds id iVertical rotate ( 0 0 1 ) ( 90 ) endinstance instance oDiamond id iPulsate rotate ( 0 0 1 ) ( 10 ) scale ( {expr 1.5 - 0.5*cos(2.0*$SLF_TIME)} {expr 1.5 - 0.5*cos(2.0*$SLF_TIME)} 1 ) endinstance endgroup group gMorph instance oMorph id iMorph rotate ( 0 0 1 ) ( -90 ) endinstance endgroup group gRoot surface sBlue instance g2Diamonds id iTopLeft translate ( -2 2 0 ) endinstance instance gTopRight id iTopRight translate ( 2 2 0 ) endinstance instance gMorph id iBottomLeft translate ( 2 -2 0 ) endinstance instance gMorph id iBottomRight rotate ( 0 0 1 ) ( -90 ) translate ( -2 -2 0 ) endinstance endgroup light Light endlight camera Camera projection SLF_PARALLEL frustum ( -4.5 -4.5 -2 ) ( 4.5 4.5 -0.01 ) endcamera window Window endwindow viewport Viewport Window origin ( 0.05 0.05 ) size ( 0.9 0.9 ) endviewport render Viewport gRoot.iTopLeft.iCamera.Camera gRoot tcltag Render light gRoot.iTopLeft.iLight.Light endrender