#version 3.8; global_settings { assumed_gamma 1.0 } #macro VectorDimTest (v0) #local vZ3D = <0, 0, 0>; #local vZ4D = <0, 0, 0, 0>; #local vZ5D = <0, 0, 0, 0, 0>; #local v1 = v0 + 1; #local v2 = v0 + 2; #local D2 = ((vZ3D + v1).z = (vZ3D + v2).z); // because when vector promotion happens, they are 0 #local D3 = ((vZ4D + v1).t = (vZ4D + v2).t); // but when the vector is the same size, all the components are the same number, and 1 != 2 #local D4 = ((vZ5D + v1).transmit = (vZ5D + v2).transmit); #if (D2) #local Size = 2; #else #if (D3) #local Size = 3; #else #if (D4) #local Size = 4; #else #local sqv0 = v0 * v0; #local v0p1 = v0 + 1; #local Result = rgb (sqv0+1) + (sqv0+1); #if (Result.transmit = Result.filter & Result.filter != Result.z) #local Size = 1; #else #local Size = 5; #end #end // if #end // if #end // if Size #end // end macro #declare Vector = array mixed { // scalar -10, -5, -1, // Negative 0, // Zero 1, 5, 10, // Positive //2D <-1, -5>, <-1, -1> // 2 negative <-1, 0>, <0, -1>, // 1 negative, 1 zero <0, 0>, // 2 zero <-1, 1>, <1, -1>, // 1 negative, 1 positive <1, 0>, <0, 1>, // 1 positivee, 1 zero <1, 1>, <1, 5>, // both positive // 3D <-1, -2, -3>, <-1, -1, -1> // 3 negative <-1, -2, 3>, <1, -2, -3>, <-1, 2, -3>, // 2 negative <-1, -2, 0>, <0, -2, -3>, <-1, 0, -3>, // 2 negative, 1 zero <-1, -2, 1>, <1, -2, -3>, <-1, 1, -3>, // 2 negative, 1 positive <-1, 0, 0>, <0, -2, 0>, <0, 0, -3>, // 1 negative, 2 zero <0, 0, 0>, // 3 zeros < 1, 0, 0>, <0, 2, 0>, <0, 0, 3>, // 1 positive, 2 zero <-1, 0, 3>, <1, -2, 0>, <0, 2, -3>, // 1 negative, 1 zero, 1 positive <-1, 2, 3>, <1, -2, 3>, <1, 2, -3>, // 1 negative, 2 positive < 1, 1, 0>, <0, 1, 1>, <1, 0, 1>, // 2 positive, 1 zero <1, 2, 3>, // 3 positive // 4D <-1, 2, 3, 4>, <1, -2, 3, 4>, <1, 2, -3, 4>, <1, 2, 3, -4>, <-1, -2, 3, 4>, <-1, 2, -3, 4>, <-1, 2, 3, -4>, <-1, -2, -3, 4>, <1, -2, -3, -4>, <-1, 2, -3, -4>, <-1, -2, -3, -4>, <-1, -2, 3, -4>, <0, 0, 0, 0>, <1, 2, 3, 4>, // 5D <1, 2, 3, 4, 5>, <1, 2, 3, 4, 5>, <1, 2, 3, 4, 5>, <1, 2, 3, 4, 5>, <1, 2, 3, 4, 5>, <1, 2, 3, 4, 5>, } #macro Component (VN) #switch (VN) #case (1) #debug concat (" V.x = ", str(Vector [V].x, 0, 0)) #break #case (2) #debug concat (", V.y = ", str(Vector [V].y, 0, 0)) #break #case (3) #debug concat (", V.z = ", str(Vector [V].z, 0, 0)) #break #case (4) #debug concat (", V.filter = ", str(Vector [V].filter, 0, 0)) #break #case (5) #debug concat (", V.transmit = ", str(Vector [V].transmit, 0, 0)) #break #end #end #declare VN = dimension_size (Vector, 1)-1; #declare LastSize = 0; #for (V, 0, VN) #local Vsize = VectorDimTest(Vector [V]); #if (Vsize > LastSize) #debug "-------- ------------\n" #end #if (Vsize = 1) #debug "Scalar " #debug concat (" Value = ", str(Vector [V], 0, 0), "\n") #else #debug concat (str(Vsize, 0, 0), "D ") #debug concat (" Value = <", vstr(Vsize, Vector [V], ", ", 1, 0), "> \n") #end #for (C, 1, Vsize) Component (C) #end #debug "\n" #local LastSize = Vsize; #end #debug "\n" #debug "\n" #debug "\n" #error "No objects in scene"