def extractgammasrf( tv, t, clr ): retval = irit.strivar( tv, irit.ROW, t ) irit.color( retval, clr ) return retval
# warpedteapot = irit.nil( ) i = 1 while ( i <= irit.SizeOf( teapot ) ): srf = irit.nth( teapot, i ) clr = irit.getattr( srf, "color" ) srf = irit.sreparam( irit.sreparam( srf, irit.COL, 0, 1 ), irit.ROW, 0,\ 1 ) srf = irit.srefine( irit.srefine( srf, irit.COL, 0, irit.list( 0.1, 0.2, 0.3, 0.4, 0.5, 0.6,\ 0.7, 0.8, 0.9 ) ), irit.ROW, 0, irit.list( 0.1, 0.2, 0.3, 0.4, 0.5, 0.6,\ 0.7, 0.8, 0.9 ) ) irit.attrib( srf, "color", clr ) irit.snoc( warpsurface( srf, tv ), warpedteapot ) i = i + 1 prmdomain = irit.list( irit.strivar( tv, irit.COL, 0 ), irit.strivar( tv, irit.COL, 0.5 ), irit.strivar( tv, irit.ROW, 0.2 ), irit.strivar( tv, irit.ROW, 0.8 ), irit.strivar( tv, irit.DEPTH, 0 ), irit.strivar( tv, irit.DEPTH, 1 ) ) irit.attrib( prmdomain, "transp", irit.GenRealObject(0.8 )) all = irit.list( warpedteapot, prmdomain ) * irit.rx( 90 ) * irit.ry( 20 ) * irit.rx( 10 ) * irit.sc( 0.5 ) interact( irit.list( all, irit.GetViewMatrix() ) ) irit.save( "warp2trv", all ) # ############################################################################ # # Let the Genie come out of the teapot... # teapot = teapotorig * irit.sc( 0.2 ) * irit.sx( (-1 ) ) * irit.rx( 90 ) * irit.rz( 180 )
irit.seval(s, 0.65, 0.21)) printtest("meval", irit.meval(ms3, irit.list(0.65, 0.21)), irit.seval(s3, 0.65, 0.21)) printtest("meval", irit.meval(mt, irit.list(0.123, 0.456, 0.789)), irit.teval(t, 0.123, 0.456, 0.789)) printtest("meval", irit.meval(mt, irit.list(0.321, 0.987, 0.654)), irit.teval(t, 0.321, 0.987, 0.654)) printtest("mfrommv", irit.csurface(s, irit.COL, 0.22), irit.coerce(irit.mfrommv(ms, 0, 0.22), irit.CURVE_TYPE)) printtest("mfrommv", irit.csurface(s, irit.ROW, 0.672), irit.coerce(irit.mfrommv(ms, 1, 0.672), irit.CURVE_TYPE)) printtest("mfrommv", irit.csurface(s3, irit.ROW, 0.872), irit.coerce(irit.mfrommv(ms3, 1, 0.872), irit.CURVE_TYPE)) printtest("mfrommv", irit.strivar(t, irit.COL, 0.16), irit.coerce(irit.mfrommv(mt, 0, 0.16), irit.SURFACE_TYPE)) printtest("mfrommv", irit.strivar(t, irit.ROW, 0.96), irit.coerce(irit.mfrommv(mt, 1, 0.96), irit.SURFACE_TYPE)) printtest("mfrommv", irit.strivar(t, irit.DEPTH, 0.66), irit.coerce(irit.mfrommv(mt, 2, 0.66), irit.SURFACE_TYPE)) printtest("mfrommesh", irit.cmesh(s, irit.ROW, 2), irit.coerce(irit.mfrommesh(ms, 1, 2), irit.CURVE_TYPE)) printtest("mfrommesh", irit.cmesh(s, irit.COL, 0), irit.coerce(irit.mfrommesh(ms, 0, 0), irit.CURVE_TYPE)) printtest("mfrommesh", irit.cmesh(s3, irit.COL, 0), irit.coerce(irit.mfrommesh(ms3, 0, 0), irit.CURVE_TYPE)) printtest("mfrommesh", irit.smesh(t, irit.COL, 1), irit.coerce(irit.mfrommesh(mt, 0, 1), irit.SURFACE_TYPE))
tv2r = irit.traise( irit.traise( irit.traise( tv2, irit.ROW, 4 ), irit.COL, 4 ), irit.DEPTH,\ 4 ) irit.color(tv2r, irit.RED) irit.interact(irit.list(tv2, tv2r * irit.tx(3))) # Reparametrization irit.save( "trivar4", irit.list( tv1, tv1r * irit.ty( (-3 ) ), tv2 * irit.tx( (-3 ) ), tv2r * irit.tx( (-3 ) ) * irit.ty( (-3 ) ), irit.treparam( irit.treparam( irit.treparam( tv2, irit.ROW, 0, 10 ), irit.COL, 0,\ 10 ), irit.DEPTH, 0, 10 ) ) ) irit.free(tv1r) irit.free(tv2r) # # Evaluation and bivariate surface extraction from a trivariate. # tv1s1 = irit.strivar(tv1, irit.COL, 0.77) irit.color(tv1s1, irit.RED) tv1s2 = irit.strivar(tv1, irit.ROW, 0.375) irit.color(tv1s2, irit.GREEN) tv1s3 = irit.strivar(tv1, irit.DEPTH, 0.31) irit.color(tv1s3, irit.CYAN) tv2s1 = irit.strivar(tv2, irit.COL, 0.4) irit.color(tv2s1, irit.RED) tv2s2 = irit.strivar(tv2, irit.ROW, 0.5) irit.color(tv2s2, irit.GREEN) tv2s3 = irit.strivar(tv2, irit.DEPTH, 0.6) irit.color(tv2s3, irit.CYAN) save_res = irit.GetResolution() irit.SetResolution(2)
i = 1 while (i <= irit.SizeOf(srfmorphlist)): irit.view(irit.nth(srfmorphlist, i), irit.ON) i = i + 1 irit.free(srfmorphlist) tv1 = irit.tfromsrfs( irit.list( page1, page2, page3, page4, page5, page6 ),\ 3, irit.KV_OPEN ) irit.interact(tv1) wmin = irit.FetchRealObject(irit.nth(irit.pdomain(tv1), 5)) wmax = irit.FetchRealObject(irit.nth(irit.pdomain(tv1), 6)) i = 0 while (i <= 100): irit.view( irit.strivar(tv1, irit.DEPTH, (wmin * (100 - i) + wmax * i) / 100), irit.ON) i = i + 1 tv1 = irit.tfromsrfs( irit.list( page1, page2, page3, page4, page5, page6 ),\ 4, irit.KV_OPEN ) irit.interact(tv1) wmin = irit.FetchRealObject(irit.nth(irit.pdomain(tv1), 5)) wmax = irit.FetchRealObject(irit.nth(irit.pdomain(tv1), 6)) i = 0 while (i <= 100): irit.view( irit.strivar(tv1, irit.DEPTH, (wmin * (100 - i) + wmax * i) / 100), irit.ON) i = i + 1