irit.color(srf2, irit.GREEN) # # Must make them compatible before doing some morphing. # irit.ffcompat(srf1, srf2) # # Since we would like the animation to look as good as possible we need # to precompute as much as possible before invoking view to erase old # drawing and display new one. That is why we precompute isolines. # i = 0 while (i <= 1): irit.view(irit.smorph(srf1, srf2, i), irit.ON) i = i + step # # Now dump 12 steps in this morphing sequence as 12 distinct files. # i = 0 while (i <= 11): msrf = irit.smorph(srf1, srf2, i / 11) irit.color(msrf, irit.WHITE) irit.attrib(msrf, "rgb", irit.GenStrObject("255,255,255")) irit.attrib(msrf, "reflect", irit.GenRealObject(1)) irit.attrib(msrf, "transp", irit.GenRealObject(0.95)) irit.attrib(msrf, "index", irit.GenRealObject(1.4)) irit.save("morp1-" + str(i), irit.list(msrf, backgrd)) i = i + 1
irit.free(bcross) irit.color(srf2, irit.GREEN) # # Must make them compatible before doing some morphing. # irit.ffcompat(srf1, srf2) # # Since we would like the animation to look as good as possible we need # to precompute as much as possible before invoking view to erase old # drawing and display new one. That is why we precompute isolines. # i = 0 while (i <= 1): irit.view(irit.smorph(srf1, srf2, i), irit.ON) i = i + step # ############################################################################ # Second Morphing Sequence. # # ############################################################################ bcross = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E3, 0, 0, (-0.71 ) ), \ irit.ctlpt( irit.E3, 0.2, 0, (-0.72 ) ), \ irit.ctlpt( irit.E3, 0.25, 0, (-0.7 ) ), \ irit.ctlpt( irit.E3, 0.25, 0, (-0.1 ) ), \ irit.ctlpt( irit.E3, 0.2, 0, (-0.05 ) ), \ irit.ctlpt( irit.E3, 0.15, 0, 0 ), \ irit.ctlpt( irit.E3, 0.1, 0, 0.6 ), \ irit.ctlpt( irit.E3, 0.11, 0, 0.61 ), \ irit.ctlpt( irit.E3, 0.12, 0, 0.61 ), \
wgl_prisa2d_frame = srflistframecrvs(wgl_prisa2d, 0.02) irit.color(wgl_prisa2d_frame, irit.RED) wgl_prisa3d_frame = srflistframecrvs(wgl_prisa3d, 0.02) irit.color(wgl_prisa3d_frame, irit.GREEN) irit.view(irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame), irit.ON) bg_obj = irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame) irit.save("wglass.itd", irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame)) i = 1 while (i <= irit.SizeOf(wgl_prisa3d)): min_gl = irit.nth(wgl_prisa2d, 1 + irit.SizeOf(wgl_prisa3d) - i) max_gl = irit.nth(wgl_prisa3d, i) irit.ffcompat(min_gl, max_gl) t = float(0) while (t <= 1): iter_gl = irit.smorph(min_gl, max_gl, t) irit.color(iter_gl, irit.CYAN) irit.view(irit.list(iter_gl, bg_obj), irit.ON) irit.save("wglass" + str(i) + "." + str(t / morph_step) + ".itd", iter_gl) t = t + morph_step irit.snoc(max_gl, built_gl) irit.color(built_gl, irit.YELLOW) irit.view(irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame, built_gl), irit.ON) bg_obj = irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame, built_gl) irit.save("wglass" + str(i) + ".itd", built_gl) i = i + 1 irit.viewclear()
def morphpage(srf1, srf2, step): irit.ffcompat(srf1, srf2) i = 0 while (i <= 1): irit.snoc(irit.smorph(srf1, srf2, i), srfmorphlist) i = i + step