Listing 2. Code Snippet--Nodal Structure of Ice Facets/Volume Reverberation Adding Target Strength & Reverb Nodes /* Target Strength & Reverberation MAKING ROUTINES */ /* Load the target strength reflected keels */ nts = 0; /* Number of keel target strengths */ for (i = startpfb; i< stoppfb; i=i+5){ sourcetime[nts] = i; /* Create load name for pfb file */ sprintf(nts_name,"./PFB/out%d.pfb",i); /* Create Target Strength switch */ ts_switch[nts]= pfNewSwitch(); /* Load Target Strength pfb file */ ts_group = pfdLoadFile(ts_name /* Create a coordinate node for * target strength */ dcs6 = pfNewDCS(); coord.xyz[PF_X] = -3300.0f; coord.xyz[PF_Y] = -650.0f; coord.xyz[PF_Z] = -125.0f; pfDCSCoord( dcs6, &coord ); /* Add target strength node to * coordinate node */ pfAddChild( dcs6, ts_group); /* Scale for good display */ pfDCSScaleXYZ( dcs6, 0.201f,0.101f,0.2f); pfDCSScaleXYZ( dcs6, 5.0f,3.3f,15.0f); /* Add Target Strength in position node * to nodal switch */ pfAddChild( ts_switch[ts], dcs6); /* Increment the Target Strength counter */ nreflects = nreflects + 1; } /* Load the reverberation field corresponding * to TSkeels */ nreverbs = 0; for (i = startpfb; i< stoppfb; i=i+5){ /* Create load name for pfb file */ sprintf(reverb_name,"./REVERB/reverb%d.pfb",i); /* Create Reverberation switch */ reverb_switch[nreverbs]= pfNewSwitch(); /* Load Reverberation pfb file */ reverb_group = pfdLoadFile(reverb_name); /* Stack the reverb planes to form a volume */ for(j=150; j<190; j++) { /* Create a coordinate node for the reverb * plane */ dcs6 = pfNewDCS(); coord.xyz[PF_X] = -450.0f; coord.xyz[PF_Y] = 300.0f; coord.xyz[PF_Z] = j*-1.0f; pfDCSCoord( dcs6, &coord ); /* Add target strength node to coordinate * node */ pfAddChild( dcs6, reverb_group); /* Scale for good display */ pfDCSScaleXYZ( dcs6, 3.5f,3.5f, 0.01f); pfDCSScaleXYZ( dcs6, 1.6f,4.3f,0.01f); /* Add Reverb plane node to nodal switch */ pfAddChild( reverb_switch[nreverbs], dcs6); } /* Increment the Reverb counter */ nreverbs = nreverbs + 1; } /**** TS and Reverb SWITCHES ADDED TO SCENE ****/ for (k = 0; k < nreflects; k++) { pfAddChild(ViewState->sceneGroup, reflect_switch[k]); ++loaded; pfSwitchVal(reflect_switch[k],PFSWITCH_OFF); } for (k = 0; k < nreverbs; k++) { pfAddChild(ViewState->sceneGroup, reverb_switch[k]); ++loaded; pfSwitchVal(reverb_switch[k],PFSWITCH_OFF); }