// // time: Thu Jan 5 15:55:57 1995 // // version: 2.0.2 (format), 2.1.0 (DX) // // MODULE main // CATEGORY Macros // // comment: This net imports a description of a tetrahedron and displays it. // comment: Things to try/add. // comment: (1) In the SurfaceProperties module modify the shading_method to for wireframe, etc. // comment: (2) Make a second tetrahedron and experiment with color and opacity. // comment: (3) Rotate, scale and translate the tetrahedron. // workspace: width = 1300, height = 1821 // layout: snap = 0, width = 50, height = 50, align = CC // macro main( ) -> ( ) { // // node Construct[1]: x = 16, y = 34, inputs = 4, label = Construct // input[1]: defaulting = 0, visible = 1, type = 16777224, value = {[0, 0, 0]} // input[2]: defaulting = 0, visible = 1, type = 16777224, value = {[1, 1, 1]} // input[3]: defaulting = 0, visible = 1, type = 8, value = [1, 1, 1] // input[4]: defaulting = 0, visible = 1, type = 16777245, value = {1} // main_Construct_1_out_1 = Construct( main_Construct_1_in_1, main_Construct_1_in_2, main_Construct_1_in_3, main_Construct_1_in_4 ) [instance: 1, cache: 1]; // // node Scalar[1]: x = 309, y = 18, inputs = 11, label = Scalar // input[1]: defaulting = 0, visible = 0, type = 32, value = "Scalar_1" // input[3]: defaulting = 0, visible = 0, type = 5, value = 0.260000 // input[4]: defaulting = 0, visible = 0, type = 3, value = 0 // input[5]: defaulting = 1, visible = 0, type = 5, value = 0.0500000 // input[6]: defaulting = 1, visible = 0, type = 5, value = 1.0 // input[7]: defaulting = 1, visible = 0, type = 5, value = 1.0 // input[9]: defaulting = 1, visible = 0, type = 1, value = 2 // output[1]: visible = 1, type = 5, value = 0.260000 // // // node Sequencer[1]: x = 463, y = 322, inputs = 7, label = Sequencer // input[1]: defaulting = 0, visible = 0, type = 32, value = "Sequencer_1" // input[4]: defaulting = 1, visible = 1, type = 1, value = 1 // input[5]: defaulting = 1, visible = 1, type = 1, value = 360 // input[6]: defaulting = 1, visible = 0, type = 1, value = 20 // input[7]: defaulting = 0, visible = 0, type = 16777217, value = { 1 360 20 1 360 1 } // main_Sequencer_1_out_1 = @frame; // // node Vector[1]: x = 206, y = 17, inputs = 11, label = Vector // input[1]: defaulting = 0, visible = 0, type = 32, value = "Vector_1" // input[3]: defaulting = 0, visible = 0, type = 8, value = [1, 0.44, 0.45] // input[4]: defaulting = 0, visible = 0, type = 3, value = 0 // input[5]: defaulting = 1, visible = 0, type = 8, value = [ 0.00000 0.00000 0.00000 ] // input[6]: defaulting = 1, visible = 0, type = 8, value = [ 1.00000 1.00000 1.00000 ] // input[7]: defaulting = 1, visible = 0, type = 8, value = [ 1 1 1] // input[9]: defaulting = 1, visible = 0, type = 8, value = [ 2.00000 2.00000 2.00000 ] // input[11]: defaulting = 1, visible = 0, type = 32, value = NULL // output[1]: visible = 1, type = 8, value = [1, 0.44, 0.45] // // // node Compute[5]: x = 459, y = 427, inputs = 1, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "3.14159" // // expression: value = 3.14159 main_Compute_5_out_1 = Compute( main_Compute_5_in_1 ) [instance: 5, cache: 1]; // // node AutoGlyph[1]: x = 22, y = 131, inputs = 7, label = AutoGlyph // input[2]: defaulting = 0, visible = 1, type = 5, value = 0.000000 // main_AutoGlyph_1_out_1 = AutoGlyph( main_Construct_1_out_1, main_AutoGlyph_1_in_2, main_AutoGlyph_1_in_3, main_AutoGlyph_1_in_4, main_AutoGlyph_1_in_5, main_AutoGlyph_1_in_6, main_AutoGlyph_1_in_7 ) [instance: 1, cache: 1]; // // node Transmitter[16]: x = 310, y = 98, inputs = 1, label = Opacity // Opacity = main_Scalar_1_out_1; // // node Transmitter[17]: x = 221, y = 104, inputs = 1, label = color // color = main_Vector_1_out_1; // // node Transmitter[15]: x = 36, y = 225, inputs = 1, label = octahedron // octahedron = main_AutoGlyph_1_out_1; // // node Receiver[41]: x = 303, y = 197, inputs = 1, label = Opacity // main_Receiver_41_out_1 = Opacity; // // node Receiver[42]: x = 118, y = 367, inputs = 1, label = color // main_Receiver_42_out_1 = color; // // node Compute[4]: x = 399, y = 515, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "[ .8+.5*sin(2*$1*$0/360) , 0 , 0]" // // expression: value = [ .8+.5*sin(2*pi*a/360) , 0 , 0] // name[2]: value = a // name[3]: value = pi main_Compute_4_out_1 = Compute( main_Compute_4_in_1, main_Sequencer_1_out_1, main_Compute_5_out_1 ) [instance: 4, cache: 1]; // // node Receiver[39]: x = 205, y = 199, inputs = 1, label = octahedron // main_Receiver_39_out_1 = octahedron; // // node Receiver[40]: x = 26, y = 360, inputs = 1, label = octahedron // main_Receiver_40_out_1 = octahedron; // // node SurfaceProperties[1]: x = 42, y = 494, inputs = 8, label = Define the tetrahedron surface // input[4]: defaulting = 0, visible = 1, type = 1, value = 3 // main_SurfaceProperties_1_out_1 = SurfaceProperties( main_Receiver_40_out_1, main_Receiver_42_out_1, main_SurfaceProperties_1_in_3, main_SurfaceProperties_1_in_4, main_SurfaceProperties_1_in_5, main_SurfaceProperties_1_in_6, main_SurfaceProperties_1_in_7, main_SurfaceProperties_1_in_8 ) [instance: 1, cache: 1]; // // node SurfaceProperties[2]: x = 230, y = 307, inputs = 8, label = SurfaceProperties // input[2]: defaulting = 0, visible = 1, type = 32, value = "cyan" // input[4]: defaulting = 0, visible = 1, type = 1, value = 3 // input[7]: defaulting = 0, visible = 1, type = 29, value = .7 // main_SurfaceProperties_2_out_1 = SurfaceProperties( main_Receiver_39_out_1, main_SurfaceProperties_2_in_2, main_Receiver_41_out_1, main_SurfaceProperties_2_in_4, main_SurfaceProperties_2_in_5, main_SurfaceProperties_2_in_6, main_SurfaceProperties_2_in_7, main_SurfaceProperties_2_in_8 ) [instance: 2, cache: 1]; // // node Rotate[6]: x = 283, y = 416, inputs = 5, label = Rotate // input[3]: defaulting = 0, visible = 1, type = 5, value = 45.000000 // input[4]: defaulting = 0, visible = 1, type = 32, value = "z" // main_Rotate_6_out_1 = Rotate( main_SurfaceProperties_2_out_1, main_Rotate_6_in_2, main_Rotate_6_in_3, main_Rotate_6_in_4, main_Sequencer_1_out_1 ) [instance: 6, cache: 1]; // // node Scale[2]: x = 289, y = 498, inputs = 2, label = Scale // input[2]: defaulting = 0, visible = 1, type = 5, value = 0.700000 // main_Scale_2_out_1 = Scale( main_Rotate_6_out_1, main_Scale_2_in_2 ) [instance: 2, cache: 1]; // // node Translate[5]: x = 298, y = 590, inputs = 2, label = Translate // main_Translate_5_out_1 = Translate( main_Scale_2_out_1, main_Compute_4_out_1 ) [instance: 5, cache: 1]; // // node Collect[6]: x = 173, y = 671, inputs = 2, label = make combined octahedra // main_Collect_6_out_1 = Collect( main_SurfaceProperties_1_out_1, main_Translate_5_out_1 ) [instance: 6, cache: 1]; // // node Image[2]: x = 180, y = 764, inputs = 35, label = Image // input[1]: defaulting = 0, visible = 0, type = 1, value = 2 // input[4]: defaulting = 0, visible = 0, type = 8, value = [0.806298 0.130945 0.185185] // input[5]: defaulting = 0, visible = 0, type = 8, value = [3.72296 5.04984 7.43062] // input[6]: defaulting = 1, visible = 0, type = 5, value = 3.1083 // input[7]: defaulting = 0, visible = 0, type = 1, value = 296 // input[8]: defaulting = 0, visible = 0, type = 5, value = 0.823 // input[9]: defaulting = 0, visible = 0, type = 8, value = [-0.081933 0.839587 -0.53701] // input[11]: defaulting = 0, visible = 0, type = 3, value = 1 // input[22]: defaulting = 0, visible = 0, type = 1, value = 1 // input[23]: defaulting = 0, visible = 0, type = 5, value = 19.115 // input[24]: defaulting = 0, visible = 0, type = 1, value = 1 // input[25]: defaulting = 0, visible = 0, type = 32, value = "none" // input[26]: defaulting = 0, visible = 0, type = 32, value = "none" // input[27]: defaulting = 0, visible = 0, type = 1, value = 1 // input[28]: defaulting = 0, visible = 0, type = 1, value = 1 // input[29]: defaulting = 0, visible = 0, type = 3, value = 1 // // depth: value = 8 main_Image_2_out_1, main_Image_2_out_2 = Image( main_Image_2_in_1, main_Collect_6_out_1, main_Image_2_in_3, main_Image_2_in_4, main_Image_2_in_5, main_Image_2_in_6, main_Image_2_in_7, main_Image_2_in_8, main_Image_2_in_9, main_Image_2_in_10, main_Image_2_in_11, main_Image_2_in_12, main_Image_2_in_13, main_Image_2_in_14, main_Image_2_in_15, main_Image_2_in_16, main_Image_2_in_17, main_Image_2_in_18, main_Image_2_in_19, main_Image_2_in_20, main_Image_2_in_21, main_Image_2_in_22, main_Image_2_in_23, main_Image_2_in_24, main_Image_2_in_25, main_Image_2_in_26, main_Image_2_in_27, main_Image_2_in_28, main_Image_2_in_29, main_Image_2_in_30, main_Image_2_in_31, main_Image_2_in_32, main_Image_2_in_33, main_Image_2_in_34, main_Image_2_in_35 ) [instance: 2, cache: 1]; // network: end of macro body } main_Construct_1_in_1 = {[0, 0, 0]}; main_Construct_1_in_2 = {[1, 1, 1]}; main_Construct_1_in_3 = [1, 1, 1]; main_Construct_1_in_4 = {1}; main_Construct_1_out_1 = NULL; main_Scalar_1_in_1 = "Scalar_1"; main_Scalar_1_in_2 = NULL; main_Scalar_1_in_3 = 0.260000; main_Scalar_1_in_4 = 0; main_Scalar_1_in_5 = NULL; main_Scalar_1_in_6 = NULL; main_Scalar_1_in_7 = NULL; main_Scalar_1_in_8 = NULL; main_Scalar_1_in_9 = NULL; main_Scalar_1_in_10 = NULL; main_Scalar_1_in_11 = NULL; main_Scalar_1_out_1 = 0.260000; main_Sequencer_1_in_1 = "Sequencer_1"; main_Sequencer_1_in_2 = NULL; main_Sequencer_1_in_3 = NULL; main_Sequencer_1_in_4 = NULL; main_Sequencer_1_in_5 = NULL; main_Sequencer_1_in_6 = NULL; main_Sequencer_1_in_7 = { 1 360 20 1 360 1 }; main_Sequencer_1_out_1 = NULL; @startframe = 1; @nextframe = @startframe; @endframe = 360; @deltaframe = 20; main_Vector_1_in_1 = "Vector_1"; main_Vector_1_in_2 = NULL; main_Vector_1_in_3 = [1, 0.44, 0.45]; main_Vector_1_in_4 = 0; main_Vector_1_in_5 = NULL; main_Vector_1_in_6 = NULL; main_Vector_1_in_7 = NULL; main_Vector_1_in_8 = NULL; main_Vector_1_in_9 = NULL; main_Vector_1_in_10 = NULL; main_Vector_1_in_11 = NULL; main_Vector_1_out_1 = [1, 0.44, 0.45]; main_Compute_5_in_1 = "3.14159"; main_Compute_5_out_1 = NULL; main_AutoGlyph_1_in_2 = 0.000000; main_AutoGlyph_1_in_3 = NULL; main_AutoGlyph_1_in_4 = NULL; main_AutoGlyph_1_in_5 = NULL; main_AutoGlyph_1_in_6 = NULL; main_AutoGlyph_1_in_7 = NULL; main_AutoGlyph_1_out_1 = NULL; main_Transmitter_16_out_1 = NULL; main_Transmitter_17_out_1 = NULL; main_Transmitter_15_out_1 = NULL; main_Receiver_41_out_1 = NULL; main_Receiver_42_out_1 = NULL; main_Compute_4_in_1 = "[ .8+.5*sin(2*$1*$0/360) , 0 , 0]"; main_Compute_4_out_1 = NULL; main_Receiver_39_out_1 = NULL; main_Receiver_40_out_1 = NULL; main_SurfaceProperties_1_in_3 = NULL; main_SurfaceProperties_1_in_4 = 3; main_SurfaceProperties_1_in_5 = NULL; main_SurfaceProperties_1_in_6 = NULL; main_SurfaceProperties_1_in_7 = NULL; main_SurfaceProperties_1_in_8 = NULL; main_SurfaceProperties_1_out_1 = NULL; main_SurfaceProperties_2_in_2 = "cyan"; main_SurfaceProperties_2_in_4 = 3; main_SurfaceProperties_2_in_5 = NULL; main_SurfaceProperties_2_in_6 = NULL; main_SurfaceProperties_2_in_7 = .7; main_SurfaceProperties_2_in_8 = NULL; main_SurfaceProperties_2_out_1 = NULL; main_Rotate_6_in_2 = NULL; main_Rotate_6_in_3 = 45.000000; main_Rotate_6_in_4 = "z"; main_Rotate_6_out_1 = NULL; main_Scale_2_in_2 = 0.700000; main_Scale_2_out_1 = NULL; main_Translate_5_out_1 = NULL; main_Collect_6_out_1 = NULL; macro Image( useVector, object, where, to, from, width, resolution, aspect, up, options, AAenable = 1, AAlabels, AAticks, AAcorners, AAframe, AAadjust, AAcursor, RECenable = 1, RECfile, throttle, RECformat, perspective, viewAngle, buttonState = 1, buttonUpApprox = "none", buttonDownApprox = "none", buttonUpDensity = 1, buttonDownDensity = 1, renderMode = 1, backgroundColor, AAgrid, AAcolors, AAannotation, AAlabelscale, AAfont) -> ( object, camera) { autoCamera = AutoCamera( object, "front", object, resolution, aspect, [0,1,0], perspective, viewAngle, backgroundColor) [instance: 1]; realCamera = Camera( to, from, width, resolution, aspect, up, perspective, viewAngle, backgroundColor) [instance: 1]; camera = Switch(useVector, autoCamera, realCamera)[instance:1]; AAobject = AutoAxes( object, camera, AAlabels, AAticks, AAcorners, AAframe, AAadjust, AAcursor, AAgrid, AAcolors, AAannotation, AAlabelscale, AAfont) [instance: 1]; object = Switch(AAenable, object, AAobject)[instance:2]; SWapproximation_options = Switch( buttonState, buttonUpApprox, buttonDownApprox) [instance: 3]; SWdensity_options = Switch( buttonState, buttonUpDensity, buttonDownDensity) [instance: 4]; HWapproximation_options = Format( "%s,%s", buttonDownApprox, buttonUpApprox) [instance: 1]; HWdensity_options = Format( "%d,%d", buttonDownDensity, buttonUpDensity) [instance: 1]; approximation_options = Switch(renderMode, SWapproximation_options, HWapproximation_options)[instance: 5]; density_options = Switch(renderMode, SWdensity_options, HWdensity_options)[instance: 6]; renderModeString = Switch(renderMode, "software", "hardware")[instance: 7]; annoted_object = Options( object, "send boxes", 0, "rendering approximation", approximation_options, "render every", density_options, "rendering mode", renderModeString) [instance: 1]; NoRECobject, RECobject = Route(RECenable, annoted_object); Display( NoRECobject, camera, where, throttle) [instance: 1]; image = Render( RECobject, camera) [instance: 1]; Display( image, NULL, where, throttle) [instance: 2]; WriteImage( image, RECfile, RECformat) [instance: 1]; } main_Image_2_in_1 = 2; main_Image_2_in_4 = [0.806298 0.130945 0.185185]; main_Image_2_in_5 = [3.72296 5.04984 7.43062]; main_Image_2_in_6 = NULL; main_Image_2_in_7 = 296; main_Image_2_in_8 = 0.823; main_Image_2_in_9 = [-0.081933 0.839587 -0.53701]; main_Image_2_in_10 = NULL; main_Image_2_in_11 = 1; main_Image_2_in_12 = NULL; main_Image_2_in_13 = NULL; main_Image_2_in_14 = NULL; main_Image_2_in_15 = NULL; main_Image_2_in_16 = NULL; main_Image_2_in_17 = NULL; main_Image_2_in_19 = NULL; main_Image_2_in_20 = NULL; main_Image_2_in_21 = NULL; main_Image_2_in_22 = 1; main_Image_2_in_23 = 19.115; main_Image_2_in_24 = 1; main_Image_2_in_25 = "none"; main_Image_2_in_26 = "none"; main_Image_2_in_27 = 1; main_Image_2_in_28 = 1; main_Image_2_in_29 = 1; main_Image_2_in_30 = NULL; main_Image_2_in_31 = NULL; main_Image_2_in_32 = NULL; main_Image_2_in_33 = NULL; main_Image_2_in_34 = NULL; main_Image_2_in_35 = NULL; Executive("product version 2 1 0"); $sync; sequence main(); play;