Attached is a *.net file where I color a tube. I would much
rather autocolor said tube according to the magnitude of the signal
which is 3D. So from my spreadsheet (or elsewhere in the data
stream) I would like the color to spread from blue to read on
this...

SQRT ( X ^^ 2 + Y ^^ 2 + Z ^^ 2 )

...so that the color reddens the further away it is from origin
in 3D space.

Have played around a fair amount to no good effect. Pray enlighten
me on the proper chain of modules.

TIA,

Gan

--

 Mistera Sturno - Rarest Extinct Bird

 <(+)__       Gan Uesli Starling
  ((__/)=-    Kalamazoo, MI, USA
   `||`
    ++        http://starling.us
//
// time: Mon Sep 13 19:00:09 2004
//
// version: 3.2.0 (format), 4.3.2 (DX)
//
//
// MODULE main
// page assignment: page_1      order=3, windowed=0, showing=0
// workspace: width = 296, height = 816
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
    // 
    // node FileSelector[1]: x = 63, y = 21, inputs = 0, label = FileSelector
    // output[1]: visible = 1, type = 32, value = 
"/spare/GMX272/rh_engmnt_az11ds_preloaded_raw.dat"
    // output[2]: visible = 1, type = 32, value = 
"rh_engmnt_az11ds_preloaded_raw.dat"
    // page group: page_1
    //
    // 
    // node ImportSpreadsheet[1]: x = 51, y = 100, inputs = 10, label = 
ImportSpreadsheet
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "\t"
    // page group: page_1
    //
main_ImportSpreadsheet_1_out_1[cache: 0],
main_ImportSpreadsheet_1_out_2[cache: 0] = 
    ImportSpreadsheet(
    main_FileSelector_1_out_1,
    main_ImportSpreadsheet_1_in_2,
    main_ImportSpreadsheet_1_in_3,
    main_ImportSpreadsheet_1_in_4,
    main_ImportSpreadsheet_1_in_5,
    main_ImportSpreadsheet_1_in_6,
    main_ImportSpreadsheet_1_in_7,
    main_ImportSpreadsheet_1_in_8,
    main_ImportSpreadsheet_1_in_9,
    main_ImportSpreadsheet_1_in_10
    ) [instance: 1, cache: 1];
    // 
    // node Mark[1]: x = 28, y = 224, inputs = 2, label = Mark
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "column0"
    // page group: page_1
    //
main_Mark_1_out_1 = 
    Mark(
    main_ImportSpreadsheet_1_out_1,
    main_Mark_1_in_2
    ) [instance: 1, cache: 1];
    // 
    // node Mark[2]: x = 96, y = 224, inputs = 2, label = Mark
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "column1"
    // page group: page_1
    //
main_Mark_2_out_1 = 
    Mark(
    main_ImportSpreadsheet_1_out_1,
    main_Mark_2_in_2
    ) [instance: 2, cache: 1];
    // 
    // node Mark[3]: x = 165, y = 223, inputs = 2, label = Mark
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "column2"
    // page group: page_1
    //
main_Mark_3_out_1 = 
    Mark(
    main_ImportSpreadsheet_1_out_1,
    main_Mark_3_in_2
    ) [instance: 3, cache: 1];
    // 
    // node Compute[1]: x = 84, y = 317, inputs = 4, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "[$0, $1, $2]"
    // page group: page_1
    // expression: value = [a, b, c]
    // name[2]: value = a
    // name[3]: value = b
    // name[4]: value = c
    //
main_Compute_1_out_1[cache: 0] = 
    Compute(
    main_Compute_1_in_1,
    main_Mark_1_out_1,
    main_Mark_2_out_1,
    main_Mark_3_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Unmark[1]: x = 105, y = 383, inputs = 2, label = Unmark
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "positions"
    // page group: page_1
    //
main_Unmark_1_out_1[cache: 0] = 
    Unmark(
    main_Compute_1_out_1,
    main_Unmark_1_in_2
    ) [instance: 1, cache: 1];
    // 
    // node ShowConnections[3]: x = 69, y = 463, inputs = 1, label = 
ShowConnections
    // page group: page_1
    //
main_ShowConnections_3_out_1 = 
    ShowConnections(
    main_Unmark_1_out_1
    ) [instance: 3, cache: 1];
    // 
    // node Scalar[1]: x = 246, y = 464, inputs = 11, label = Scalar
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "Scalar_1"
    // input[3]: defaulting = 0, visible = 0, type = 5, value = 40.0 
    // input[5]: defaulting = 1, visible = 0, type = 5, value = 0.0
    // input[6]: defaulting = 1, visible = 0, type = 5, value = 50.0
    // input[7]: defaulting = 1, visible = 0, type = 5, value = 1.0
    // input[9]: defaulting = 1, visible = 0, type = 1, value = 0
    // output[1]: visible = 1, type = 5, value = 40.0 
    // page group: page_1
    //
    // 
    // node Tube[1]: x = 123, y = 564, inputs = 4, label = Tube
    // page group: page_1
    //
main_Tube_1_out_1 = 
    Tube(
    main_ShowConnections_3_out_1,
    main_Scalar_1_out_1,
    main_Tube_1_in_3,
    main_Tube_1_in_4
    ) [instance: 1, cache: 1];
    // 
    // node Color[1]: x = 135, y = 657, inputs = 5, label = Color
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "blue"
    // input[3]: defaulting = 0, visible = 1, type = 5, value = .5
    // page group: page_1
    //
main_Color_1_out_1[cache: 0] = 
    Color(
    main_Tube_1_out_1,
    main_Color_1_in_2,
    main_Color_1_in_3,
    main_Color_1_in_4,
    main_Color_1_in_5
    ) [instance: 1, cache: 1];
    // 
    // node Image[1]: x = 135, y = 754, inputs = 49, label = Image
    // input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1"
    // input[4]: defaulting = 0, visible = 0, type = 1, value = 1
    // input[5]: defaulting = 0, visible = 0, type = 8, value = [-474.322 
375.857 -4043.15]
    // input[6]: defaulting = 0, visible = 0, type = 8, value = [-19783.1 
-10129.5 -6548.59]
    // input[7]: defaulting = 0, visible = 0, type = 5, value = 15780.9
    // input[8]: defaulting = 0, visible = 0, type = 1, value = 893
    // input[9]: defaulting = 0, visible = 0, type = 5, value = 1.021
    // input[10]: defaulting = 0, visible = 0, type = 8, value = [0.481614 
-0.79971 -0.358486]
    // input[11]: defaulting = 1, visible = 0, type = 5, value = 39.2573
    // input[12]: defaulting = 0, visible = 0, type = 1, value = 0
    // input[14]: defaulting = 0, visible = 0, type = 1, value = 1
    // input[15]: defaulting = 1, visible = 0, type = 32, value = "none"
    // input[16]: defaulting = 1, visible = 0, type = 32, value = "none"
    // input[17]: defaulting = 1, visible = 0, type = 1, value = 1
    // input[18]: defaulting = 1, visible = 0, type = 1, value = 1
    // input[19]: defaulting = 0, visible = 0, type = 1, value = 0
    // input[22]: defaulting = 0, visible = 0, type = 32, value = "black"
    // input[25]: defaulting = 0, visible = 0, type = 32, value = 
"/keyfob/gmx272/sx01ds_vs_sy01ds_diagonal.tiff"
    // input[26]: defaulting = 0, visible = 0, type = 32, value = "tiff"
    // input[29]: defaulting = 0, visible = 0, type = 3, value = 1
    // input[30]: defaulting = 0, visible = 0, type = 16777248, value = 
{"Rear", "Right", "Up"}
    // input[31]: defaulting = 0, visible = 0, type = 1, value = 15
    // input[33]: defaulting = 0, visible = 0, type = 3, value = 1
    // input[36]: defaulting = 0, visible = 0, type = 3, value = 1
    // input[37]: defaulting = 0, visible = 0, type = 16777248, value = 
{"white", "grey75", "yellow", "white"}
    // input[38]: defaulting = 0, visible = 0, type = 16777248, value = 
{"background", "grid", "ticks", "labels"}
    // input[39]: defaulting = 0, visible = 0, type = 5, value = 0.5
    // input[41]: defaulting = 0, visible = 0, type = 32, value = "panzoom"
    // page group: page_1
    // depth: value = 24
    // window: position = (0.0000,0.0000), size = 0.7086x0.9307
    // internal caching: 0
    //
main_Image_1_out_1[cache: 0],
main_Image_1_out_2[cache: 0],
main_Image_1_out_3[cache: 0] = 
    Image(
    main_Image_1_in_1,
    main_Color_1_out_1,
    main_Image_1_in_3,
    main_Image_1_in_4,
    main_Image_1_in_5,
    main_Image_1_in_6,
    main_Image_1_in_7,
    main_Image_1_in_8,
    main_Image_1_in_9,
    main_Image_1_in_10,
    main_Image_1_in_11,
    main_Image_1_in_12,
    main_Image_1_in_13,
    main_Image_1_in_14,
    main_Image_1_in_15,
    main_Image_1_in_16,
    main_Image_1_in_17,
    main_Image_1_in_18,
    main_Image_1_in_19,
    main_Image_1_in_20,
    main_Image_1_in_21,
    main_Image_1_in_22,
    main_Image_1_in_23,
    main_Image_1_in_24,
    main_Image_1_in_25,
    main_Image_1_in_26,
    main_Image_1_in_27,
    main_Image_1_in_28,
    main_Image_1_in_29,
    main_Image_1_in_30,
    main_Image_1_in_31,
    main_Image_1_in_32,
    main_Image_1_in_33,
    main_Image_1_in_34,
    main_Image_1_in_35,
    main_Image_1_in_36,
    main_Image_1_in_37,
    main_Image_1_in_38,
    main_Image_1_in_39,
    main_Image_1_in_40,
    main_Image_1_in_41,
    main_Image_1_in_42,
    main_Image_1_in_43,
    main_Image_1_in_44,
    main_Image_1_in_45,
    main_Image_1_in_46,
    main_Image_1_in_47,
    main_Image_1_in_48,
    main_Image_1_in_49
    ) [instance: 1, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_FileSelector_1_out_1 = "/spare/GMX272/rh_engmnt_az11ds_preloaded_raw.dat";
main_ImportSpreadsheet_1_in_2 = "\t";
main_ImportSpreadsheet_1_in_3 = NULL;
main_ImportSpreadsheet_1_in_4 = NULL;
main_ImportSpreadsheet_1_in_5 = NULL;
main_ImportSpreadsheet_1_in_6 = NULL;
main_ImportSpreadsheet_1_in_7 = NULL;
main_ImportSpreadsheet_1_in_8 = NULL;
main_ImportSpreadsheet_1_in_9 = NULL;
main_ImportSpreadsheet_1_in_10 = NULL;
main_ImportSpreadsheet_1_out_1 = NULL;
main_Mark_1_in_2 = "column0";
main_Mark_1_out_1 = NULL;
main_Mark_2_in_2 = "column1";
main_Mark_2_out_1 = NULL;
main_Mark_3_in_2 = "column2";
main_Mark_3_out_1 = NULL;
main_Compute_1_in_1 = "[$0, $1, $2]";
main_Compute_1_out_1 = NULL;
main_Unmark_1_in_2 = "positions";
main_Unmark_1_out_1 = NULL;
main_ShowConnections_3_out_1 = NULL;
main_Scalar_1_in_1 = "Scalar_1";
main_Scalar_1_in_2 = NULL;
main_Scalar_1_in_3 = 40.0 ;
main_Scalar_1_in_4 = NULL;
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 = 40.0 ;
main_Tube_1_in_3 = NULL;
main_Tube_1_in_4 = NULL;
main_Tube_1_out_1 = NULL;
main_Color_1_in_2 = "blue";
main_Color_1_in_3 = .5;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
macro Image(
        id,
        object,
        where,
        useVector,
        to,
        from,
        width,
        resolution,
        aspect,
        up,
        viewAngle,
        perspective,
        options,
        buttonState = 1,
        buttonUpApprox = "none",
        buttonDownApprox = "none",
        buttonUpDensity = 1,
        buttonDownDensity = 1,
        renderMode = 0,
        defaultCamera,
        reset,
        backgroundColor,
        throttle,
        RECenable = 0,
        RECfile,
        RECformat,
        RECresolution,
        RECaspect,
        AAenable = 0,
        AAlabels,
        AAticks,
        AAcorners,
        AAframe,
        AAadjust,
        AAcursor,
        AAgrid,
        AAcolors,
        AAannotation,
        AAlabelscale,
        AAfont,
        interactionMode,
        title,
        AAxTickLocs,
        AAyTickLocs,
        AAzTickLocs,
        AAxTickLabels,
        AAyTickLabels,
        AAzTickLabels,
        webOptions) -> (
        object,
        camera,
        where)
{
    ImageMessage(
        id,
        backgroundColor,
        throttle,
        RECenable,
        RECfile,
        RECformat,
        RECresolution,
        RECaspect,
        AAenable,
        AAlabels,
        AAticks,
        AAcorners,
        AAframe,
        AAadjust,
        AAcursor,
        AAgrid,
        AAcolors,
        AAannotation,
        AAlabelscale,
        AAfont,
        AAxTickLocs,
        AAyTickLocs,
        AAzTickLocs,
        AAxTickLabels,
        AAyTickLabels,
        AAzTickLabels,
        interactionMode,
        title,
        renderMode,
        buttonUpApprox,
        buttonDownApprox,
        buttonUpDensity,
        buttonDownDensity) [instance: 1, cache: 0];
    autoCamera =
        AutoCamera(
            object,
            "front",
            object,
            resolution,
            aspect,
            [0,1,0],
            perspective,
            viewAngle,
            backgroundColor) [instance: 1, cache: 0];
    realCamera =
        Camera(
            to,
            from,
            width,
            resolution,
            aspect,
            up,
            perspective,
            viewAngle,
            backgroundColor) [instance: 1, cache: 0];
    coloredDefaultCamera = 
         UpdateCamera(defaultCamera,
            background=backgroundColor) [instance: 1, cache: 0];
    nullDefaultCamera =
        Inquire(defaultCamera,
            "is null + 1") [instance: 1, cache: 0];
    resetCamera =
        Switch(
            nullDefaultCamera,
            coloredDefaultCamera,
            autoCamera) [instance: 1, cache: 0];
    resetNull = 
        Inquire(
            reset,
            "is null + 1") [instance: 2, cache: 0];
    reset =
        Switch(
            resetNull,
            reset,
            0) [instance: 2, cache: 0];
    whichCamera =
        Compute(
            "($0 != 0 || $1 == 0) ? 1 : 2",
            reset,
            useVector) [instance: 1, cache: 0];
    camera = Switch(
            whichCamera,
            resetCamera,
            realCamera) [instance: 3, cache: 0];
    AAobject =
        AutoAxes(
            object,
            camera,
            AAlabels,
            AAticks,
            AAcorners,
            AAframe,
            AAadjust,
            AAcursor,
            AAgrid,
            AAcolors,
            AAannotation,
            AAlabelscale,
            AAfont,
            AAxTickLocs,
            AAyTickLocs,
            AAzTickLocs,
            AAxTickLabels,
            AAyTickLabels,
            AAzTickLabels) [instance: 1, cache: 0];
    switchAAenable = Compute("$0+1",
             AAenable) [instance: 2, cache: 0];
    object = Switch(
             switchAAenable,
             object,
             AAobject) [instance:4, cache: 0];
    SWapproximation_options =
        Switch(
            buttonState,
            buttonUpApprox,
            buttonDownApprox) [instance: 5, cache: 0];
    SWdensity_options =
        Switch(
            buttonState,
            buttonUpDensity,
            buttonDownDensity) [instance: 6, cache: 0];
    HWapproximation_options =
        Format(
            "%s,%s",
            buttonDownApprox,
            buttonUpApprox) [instance: 1, cache: 0];
    HWdensity_options =
        Format(
            "%d,%d",
            buttonDownDensity,
            buttonUpDensity) [instance: 2, cache: 0];
    switchRenderMode = Compute(
             "$0+1",
             renderMode) [instance: 3, cache: 0];
    approximation_options = Switch(
             switchRenderMode,
            SWapproximation_options,
             HWapproximation_options) [instance: 7, cache: 0];
    density_options = Switch(
             switchRenderMode,
            SWdensity_options,
            HWdensity_options) [instance: 8, cache: 0];
    renderModeString = Switch(
            switchRenderMode,
            "software",
            "hardware")[instance: 9, cache: 0];
    object_tag = Inquire(
            object,
            "object tag")[instance: 3, cache: 0];
    annoted_object =
        Options(
            object,
            "send boxes",
            0,
            "cache",
            0,
            "object tag",
            object_tag,
            "ddcamera",
            whichCamera,
            "rendering approximation",
            approximation_options,
            "render every",
            density_options,
            "button state",
            buttonState,
            "rendering mode",
            renderModeString) [instance: 1, cache: 0];
    RECresNull =
        Inquire(
            RECresolution,
            "is null + 1") [instance: 4, cache: 0];
    ImageResolution =
        Inquire(
            camera,
            "camera resolution") [instance: 5, cache: 0];
    RECresolution =
        Switch(
            RECresNull,
            RECresolution,
            ImageResolution) [instance: 10, cache: 0];
    RECaspectNull =
        Inquire(
            RECaspect,
            "is null + 1") [instance: 6, cache: 0];
    ImageAspect =
        Inquire(
            camera,
            "camera aspect") [instance: 7, cache: 0];
    RECaspect =
        Switch(
            RECaspectNull,
            RECaspect,
            ImageAspect) [instance: 11, cache: 0];
    switchRECenable = Compute(
          "$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
            RECenable,
            switchRenderMode,
            RECresolution,
            ImageResolution,
            RECaspect,
             ImageAspect) [instance: 4, cache: 0];
    NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = 
Route(switchRECenable, annoted_object);
    Display(
        NoRECobject,
        camera,
        where,
        throttle) [instance: 1, cache: 0];
    image =
        Render(
            RECNoRerenderObject,
            camera) [instance: 1, cache: 0];
    Display(
        image,
        NULL,
        where,
        throttle) [instance: 2, cache: 0];
    WriteImage(
        image,
        RECfile,
        RECformat) [instance: 1, cache: 0];
    rec_where = Display(
        RECNoRerHW,
        camera,
        where,
        throttle) [instance: 1, cache: 0];
    rec_image = ReadImageWindow(
        rec_where) [instance: 1, cache: 0];
    WriteImage(
        rec_image,
        RECfile,
        RECformat) [instance: 1, cache: 0];
    RECupdateCamera =
        UpdateCamera(
            camera,
            resolution=RECresolution,
            aspect=RECaspect) [instance: 2, cache: 0];
    Display(
        RECRerenderObject,
        camera,
        where,
        throttle) [instance: 1, cache: 0];
    RECRerenderObject =
        ScaleScreen(
            RECRerenderObject,
            NULL,
            RECresolution,
            camera) [instance: 1, cache: 0];
    image =
        Render(
            RECRerenderObject,
            RECupdateCamera) [instance: 2, cache: 0];
    WriteImage(
        image,
        RECfile,
        RECformat) [instance: 2, cache: 0];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 1;
main_Image_1_in_5 = [-474.322 375.857 -4043.15];
main_Image_1_in_6 = [-19783.1 -10129.5 -6548.59];
main_Image_1_in_7 = 15780.9;
main_Image_1_in_8 = 893;
main_Image_1_in_9 = 1.021;
main_Image_1_in_10 = [0.481614 -0.79971 -0.358486];
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = 0;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = NULL;
main_Image_1_in_18 = NULL;
main_Image_1_in_19 = 0;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = "black";
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = "/keyfob/gmx272/sx01ds_vs_sy01ds_diagonal.tiff";
main_Image_1_in_26 = "tiff";
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = 1;
main_Image_1_in_30 = {"Rear", "Right", "Up"};
main_Image_1_in_31 = 15;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = 1;
main_Image_1_in_34 = NULL;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = 1;
main_Image_1_in_37 = {"white", "grey75", "yellow", "white"};
main_Image_1_in_38 = {"background", "grid", "ticks", "labels"};
main_Image_1_in_39 = 0.5;
main_Image_1_in_40 = NULL;
main_Image_1_in_41 = "panzoom";
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
Executive("product version 4 3 2");
$sync
main();

Reply via email to