#version 3.7; global_settings { assumed_gamma 1.0 } //------------------------------------------ // SDL for // Bill Walker - 2016 //------------------------------------------ #include "colors.inc" #include "debug.inc" Set_Debug (true) #include "math.inc" #include "rand.inc" #include "shapes.inc" #include "metals.inc" #include "transforms.inc" //############################################### #declare XImageSize = 1024; #declare YImageSize = 768; //############################################### light_source { <0, 50, -50> color rgb <1, 1, 1>} #declare Camera_Front = camera { location <0, 1, -5> //right x*image_width/image_height look_at <0, 1, 0>} camera {Camera_Front} sky_sphere { pigment {Blue} } //======================================================================================================================= // read data file to determine how many data points there are for array #ifndef (Vibration_Data) #fopen Vibration_Data "VibrationData.txt" read #end #declare Points = 0; #declare X = 0; #declare Y = 0; #while (defined (Vibration_Data)) #read (Vibration_Data, X, Y) // Capitalized X and Y #debug "\n ###### Vibrational Data Set ###### \n" #debug concat( " Point = ", str(X, 3, 3), ", ", str(Y, 3, 3), "\n") #debug "\n ###### End of Data Set ###### \n\n" #declare Points = Points + 1; // "log" that a[nother] set of data points got read // read 2 values. If an error accurs, it's likely due to an odd number of data points. #end // end while #fclose Vibration_Data // read data into array #ifndef (Vibration_Data) #fopen Vibration_Data "VibrationData.txt" read #end #declare Column = 0; #declare X = 0; #declare Y = 0; #declare Vibrations = array [Points][2]; #while (defined(Vibration_Data)) #read (Vibration_Data, X, Y) #declare Vibrations [Column][0] = X; #declare Vibrations [Column][1] = Y; #declare Column = Column + 1; #end // end while #fclose Vibration_Data triangle { pigment {color Yellow} }