diff --git a/galaxy/AllObjs.pov b/galaxy/AllObjs.pov new file mode 100644 index 0000000..6e94405 --- /dev/null +++ b/galaxy/AllObjs.pov @@ -0,0 +1,61 @@ +// GALAXY INCLUDE FILE: SAMPLE GALAXY OBJECTS +// ****************************************** +// This scene shows all of the twenty galaxy objects created by +// Galaxy.obj. They are grouped by row (Stars, Nebulae, Galaxies, +// Comets, and Meteors at the bottom), numbered from left to right +// (starting at 1). For more information on using these objects, +// see Galaxy.txt +// +// Recommended resolution: 800 x 600 or larger, no anti-aliasing + +// NARROW ANGLE CAMERA (TO PREVENT DISTORTION) + camera {location <0, 0, 0> look_at <0, 0, 1> angle 24} + +// COMMON GALAXY OPTIONS + #declare galaxy_colour1 = <1.3, 1.2, .9>; + #declare galaxy_colour2 = <.4, .8, 1>; + #declare galaxy_cluster_name = "" + +// STARFIELD BACKGROUND + #declare galaxy_bgstars = 2; + #declare galaxy_bgnebula = false; + #declare galaxy_nebula_sphere = false; + #include "GALAXY.BG" + +// STAR OBJECTS + #declare galaxy_object_scale = .2; + #declare C = 0; #while (C < 4) + #declare galaxy_object_name = concat("Star", str(C + 1, 0, 0)) + #declare galaxy_object_position = <7, -10 + C * 4, 0>; + #include "GALAXY.OBJ" + #declare C = C + 1; #end + +// NEBULAE OBJECTS + #declare galaxy_object_scale = .15; + #declare C = 0; #while (C < 6) + #declare galaxy_object_name = concat("Nebula", str(C + 1, 0, 0)) + #declare galaxy_object_position = <3, -10 + C * 4, 0>; + #include "GALAXY.OBJ" + #declare C = C + 1; #end + +// GALAXY OBJECTS + #declare galaxy_object_rotate = 30; + #declare C = 0; #while (C < 5) + #declare galaxy_object_name = concat("Galaxy", str(C + 1, 0, 0)) + #declare galaxy_object_position = <-1, -10 + C * 4, 0>; + #include "GALAXY.OBJ" + #declare C = C + 1; #end + +// COMET OBJECTS + #declare C = 0; #while (C < 3) + #declare galaxy_object_name = concat("Comet", str(C + 1, 0, 0)) + #declare galaxy_object_position = <-4.5, -11 + C * 4, 0>; + #include "GALAXY.OBJ" + #declare C = C + 1; #end + +// METEOR OBJECTS + #declare C = 0; #while (C < 2) + #declare galaxy_object_name = concat("Meteor", str(C + 1, 0, 0)) + #declare galaxy_object_position = <-7.5, -11 + C * 4, 0>; + #include "GALAXY.OBJ" + #declare C = C + 1; #end diff --git a/galaxy/DnmcOpts.pov b/galaxy/DnmcOpts.pov new file mode 100644 index 0000000..c840ee2 --- /dev/null +++ b/galaxy/DnmcOpts.pov @@ -0,0 +1,20 @@ +// GALAXY INCLUDE FILE: DYNAMIC OPTIONS ANIMATION +// ********************************************** +// This animation shows the effect of various galaxy options on the +// resulting galaxy scene. +// +// Recommended frames: 50 to 100, cyclic animation + +// BACKGROUND STARFIELD AND MILKY WAY + #declare galaxy_bgstars = 5; + #declare galaxy_bgnebula = 6; + #declare galaxy_nebula_sphere = false; + #include "GALAXY.BG" + +// ANIMATED NEBULA + #declare galaxy_nebula_sphere = 1; + #declare galaxy_colour1 = <1, .5, .4> + <0, .5, .2> * (sin((clock - .25) * pi) + 1) / 2; + #declare galaxy_colour2 = <0, .5, 1> + <1, -.3, -.3> * (sin((clock - .25) * pi) + 1) / 2; + #declare galaxy_pattern_scale = 1 + .4 * sin(clock * 2 * pi); + #declare galaxy_pattern_origin = <-10, 10, 10> + vrotate (z * .2, <45 * sin(clock * pi * 4), clock * 360, 0>); + #include "GALAXY.BG" diff --git a/galaxy/GALAXY.BG b/galaxy/GALAXY.BG new file mode 100644 index 0000000..3f3536a --- /dev/null +++ b/galaxy/GALAXY.BG @@ -0,0 +1,180 @@ +/************************************************************************* + GALAXY BACKGROUNDS FILE FOR PERSISTENCE OF VISION 3.x +************************************************************************** + +Created by Chris Colefax, 1 February 1998 +Updated 9 August 1998: updated for POV-Ray 3.1 + +See "Galaxy.htm" for more information. + +*************************************************************************/ + +// CHECK VARIABLES AND ASSIGN DEFAULTS +// *********************************** + #declare _GX_bgtempver = version; #version 3.0; + #ifndef (galaxy_declare_only) #declare galaxy_declare_only = false; #end + #ifndef (galaxy_bgstars) #declare galaxy_bgstars = 2; #end + #ifndef (galaxy_bgnebula) #declare galaxy_bgnebula = 6; #end + #ifndef (galaxy_nebula_sphere) #declare galaxy_nebula_sphere = 1; #end + #ifndef (galaxy_nebula_ambient) #declare _GX_nebambient = <1, 1, 1>; #else #declare _GX_nebambient = galaxy_nebula_ambient * <1, 1, 1>; #end + #ifndef (galaxy_distance) #declare galaxy_distance = 1e4; #end + #ifndef (galaxy_pattern_scale) #declare galaxy_pattern_scale = 1; #end + #ifndef (galaxy_pattern_origin) #declare galaxy_pattern_origin = <0, 0, 0>; #end + #ifndef (galaxy_turb_origin) #declare galaxy_turb_origin = <0, 0, 0>; #end + #ifndef (galaxy_intensity) #declare galaxy_intensity = 1; #end + + #ifdef (galaxy_colour1) #declare _GX_colour1 = galaxy_colour1 * <1, 1, 1>; + #else #ifdef (galaxy_color1) #declare _GX_colour1 = galaxy_color1 * <1, 1, 1>; + #else #declare _GX_colour1 = <1, 1, 1>; #end #end + #ifdef (galaxy_colour2) #declare _GX_colour2 = galaxy_colour2 * <1, 1, 1>; + #else #ifdef (galaxy_color2) #declare _GX_colour2 = galaxy_color2 * <1, 1, 1>; + #else #declare _GX_colour2 = _GX_colour1 - .3; #end #end + #ifdef (galaxy_colour3) #declare _GX_colour3 = galaxy_colour3 * <1, 1, 1>; + #else #ifdef (galaxy_color3) #declare _GX_colour3 = galaxy_color3 * <1, 1, 1>; + #else #declare _GX_colour3 = (_GX_colour1 + _GX_colour2) / 2; #end #end + #ifdef (galaxy_star_colouration) #declare _GX_starcolouration = galaxy_star_colouration; + #else #ifdef (galaxy_star_coloration) #declare _GX_starcolouration = galaxy_star_coloration; + #else #declare _GX_starcolouration = .2; #end #end + + #declare _GX_finaltranslate = galaxy_turb_origin - galaxy_pattern_origin; + #ifndef (_GX_tracelevel) #declare _GX_tracelevel = 5; #end + +// CALCULATE STAR COLOURS +// ********************** + #if (_GX_starcolouration = 1) + #declare _GX_starcolour1 = _GX_colour1; + #declare _GX_starcolour2 = _GX_colour2; + #declare _GX_starcolour3 = _GX_colour3; + #else + #declare _GX_tempfloat1 = max(_GX_colour1.x, _GX_colour1.y); #declare _GX_tempfloat1 = max(_GX_tempfloat1, _GX_colour1.z); + #declare _GX_tempfloat2 = min(_GX_colour1.x, _GX_colour1.y); #declare _GX_tempfloat2 = min(_GX_tempfloat2, _GX_colour1.z); + #declare _GX_tempfloat1 = (_GX_tempfloat1 + _GX_tempfloat2) / 2; #declare _GX_starcolour1 = _GX_tempfloat1 + (_GX_colour1 - _GX_tempfloat1) * _GX_starcolouration; + + #declare _GX_tempfloat1 = max(_GX_colour2.x, _GX_colour2.y); #declare _GX_tempfloat1 = max(_GX_tempfloat1, _GX_colour2.z); + #declare _GX_tempfloat2 = min(_GX_colour2.x, _GX_colour2.y); #declare _GX_tempfloat2 = min(_GX_tempfloat2, _GX_colour2.z); + #declare _GX_tempfloat1 = (_GX_tempfloat1 + _GX_tempfloat2) / 2; #declare _GX_starcolour2 = _GX_tempfloat1 + (_GX_colour2 - _GX_tempfloat1) * _GX_starcolouration; + + #declare _GX_tempfloat1 = max(_GX_colour3.x, _GX_colour3.y); #declare _GX_tempfloat1 = max(_GX_tempfloat1, _GX_colour3.z); + #declare _GX_tempfloat2 = min(_GX_colour3.x, _GX_colour3.y); #declare _GX_tempfloat2 = min(_GX_tempfloat2, _GX_colour3.z); + #declare _GX_tempfloat1 = (_GX_tempfloat1 + _GX_tempfloat2) / 2; #declare _GX_starcolour3 = _GX_tempfloat1 + (_GX_colour3 - _GX_tempfloat1) * _GX_starcolouration; + #end + +// CREATE STAR PIGMENTS +// ******************** + #declare BGStars1 = pigment {leopard color_map { + [.6 rgb 0] [.9 rgb _GX_starcolour2 * .1] [.98 rgb _GX_starcolour3 * .4] [1 rgb _GX_starcolour1 * galaxy_intensity]} + scale 1e-15 translate -galaxy_pattern_origin} + + #declare BGStars2 = pigment {leopard color_map { + [.4 rgb 0] [.75 rgb _GX_starcolour2 * .2] [.95 rgb _GX_starcolour3 * .5] [1 rgb _GX_starcolour1 * galaxy_intensity]} + scale 1e-15 translate -galaxy_pattern_origin} + + #declare BGStars3 = pigment {leopard color_map { + [.1 rgb 0] [.5 rgb _GX_starcolour2 * .3] [.85 rgb _GX_starcolour3 * .6] [1 rgb _GX_starcolour1 * galaxy_intensity]} + scale 1e-15 translate -galaxy_pattern_origin} + + #declare BGStars4 = pigment {leopard color_map { + [.97 rgb 0] [.975 rgb _GX_starcolour2 * galaxy_intensity] + [.98 rgb 0] [.985 rgb _GX_starcolour3 * galaxy_intensity] + [.99 rgb 0] [1 rgb _GX_starcolour1 * galaxy_intensity]} + scale 1e-15 translate -galaxy_pattern_origin} + + #declare BGStars5 = pigment {leopard color_map { + [.85 rgb 0] [.87 rgb _GX_starcolour2 * galaxy_intensity] + [.89 rgb 0] [.92 rgb _GX_starcolour3 * galaxy_intensity] + [.95 rgb 0] [1 rgb _GX_starcolour1 * galaxy_intensity]} + scale 1e-15 translate -galaxy_pattern_origin} + + #declare BGStars6 = pigment {leopard color_map { + [.7 rgb 0] [.75 rgb _GX_starcolour2 * 1.5 * galaxy_intensity] + [.8 rgb 0] [.85 rgb _GX_starcolour3 * 1.5 * galaxy_intensity] + [.9 rgb 0] [1 rgb _GX_starcolour1 * 1.5 * galaxy_intensity]} + scale 1e-15 translate -galaxy_pattern_origin} + + #declare BGMilkyWay = pigment {gradient y pigment_map { + [.03 granite color_map {[.1 rgb _GX_starcolour3 transmit pow(.9, galaxy_intensity)] [.8 rgb _GX_starcolour1 transmit pow(.7, galaxy_intensity)]} scale .8 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.08 granite color_map {[.4 rgb _GX_starcolour2 transmit 1] [1 rgb _GX_starcolour3 transmit pow(.8, galaxy_intensity)]} scale .6 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.1 rgb _GX_starcolour2 transmit 1]} + scale 3 + translate -galaxy_turb_origin warp {turbulence .3 octaves 4 lambda 3} translate galaxy_turb_origin} + +// CREATE NEBULAE PIGMENTS +// *********************** + #declare BGNebula1 = pigment {bozo pigment_map { + [-.3 granite color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour1 transmit pow(.6, galaxy_intensity)]} scale 6 * galaxy_pattern_scale] + [.4 granite color_map {[0 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)] [.5 rgb _GX_colour2 transmit pow(.95, galaxy_intensity)]} scale 3 * galaxy_pattern_scale] + [.9 rgb _GX_colour2 transmit 1]} + scale .3 + translate -galaxy_turb_origin warp {turbulence .18 octaves 4 omega .4 lambda 3} translate _GX_finaltranslate} + + #declare BGNebula2 = pigment {bozo pigment_map { + [-.3 wrinkles color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)]} + warp {turbulence 2 octaves 1} scale 1.5 * galaxy_pattern_scale] + [.4 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.5, galaxy_intensity)] [.5 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)]} + warp {turbulence 1 octaves 1} scale galaxy_pattern_scale] + [.7 rgb _GX_colour2 transmit 1]} + scale .3 + translate -galaxy_turb_origin warp {turbulence .15 octaves 2 lambda 4} translate _GX_finaltranslate} + + #declare BGNebula3 = pigment {leopard pigment_map { + [-.1 rgbt _GX_colour2 transmit 1] + [.4 wrinkles color_map {[0 rgb _GX_colour2 transmit 1] [1 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)]} + scale .8 * galaxy_pattern_scale translate -galaxy_turb_origin] + [1 granite color_map {[.05 rgb _GX_colour3 transmit 1] [.3 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)]} + scale 6 * galaxy_pattern_scale translate galaxy_turb_origin]} + scale .13 + translate -galaxy_turb_origin warp {turbulence .3 octaves 4 lambda 3 omega .4} translate _GX_finaltranslate} + + #declare BGNebula4 = pigment {bozo pigment_map { + [0 granite color_map {[0 rgb _GX_colour1 transmit pow(.4, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.95, galaxy_intensity)]} scale 2 * galaxy_pattern_scale] + [.6 granite color_map {[0 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)] [.4 rgb _GX_colour2 transmit 1]} scale 1.7 * galaxy_pattern_scale] + [.9 rgb _GX_colour2 transmit 1]} + scale .3 + translate -galaxy_turb_origin warp {turbulence .5 octaves 4 omega .4 lambda 3} translate _GX_finaltranslate} + + #declare BGNebula5 = pigment {bozo pigment_map { + [-.1 wrinkles color_map {[.1 rgb _GX_colour2 transmit 1] [.4 rgb _GX_colour3 transmit pow(.5, galaxy_intensity)] [.8 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)]} scale .3 * galaxy_pattern_scale] + [.4 wrinkles color_map {[.5 rgb _GX_colour2 transmit 1] [1 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)]} scale .3 * galaxy_pattern_scale] + [.6 rgb _GX_colour2 transmit 1]} + scale .22 + translate -galaxy_turb_origin warp {turbulence .2 octaves 4 omega .3 lambda 5} translate _GX_finaltranslate} + +// CREATE GALAXY BACKGROUND (SKYSPHERE) +// ************************************ + #if (galaxy_declare_only = false) + #ifndef (galaxy_sky_sphere) #if (galaxy_bgstars != false | galaxy_bgnebula != false) + sky_sphere { + #if (galaxy_bgstars != false) pigment { #switch (abs(int(galaxy_bgstars))) + #case (1) BGStars1 #break #case (3) BGStars3 #break #case (4) BGStars4 #break + #case (5) BGStars5 #break #case (6) BGStars6 #break #else BGStars2 #end } + #end + #if (galaxy_bgnebula != false) pigment { #switch (abs(int(galaxy_bgnebula))) + #case (1) BGNebula1 #break #case (2) BGNebula2 #break #case (3) BGNebula3 #break + #case (4) BGNebula4 #break #case (5) BGNebula5 #break #else BGMilkyWay #end + #ifdef (galaxy_rotate) rotate galaxy_rotate #end } + #end + } + #declare galaxy_sky_sphere = false; + #declare galaxy_bgstars = false; + #declare galaxy_bgnebula = false; + +// CREATE DUMMY OBJECT (TO PREVENT "No objects in scene" ERROR) +// ************************************************************ + #if (galaxy_nebula_sphere = false) sphere {<0, 0, 0>, 0 pigment {rgb <0, 0, 0>}} #end + #end #end + +// CREATE NEBULA SPHERE +// ******************** + #if (galaxy_nebula_sphere != false) sphere {<0, 0, 0>, 1 + pigment { #switch (abs(int(galaxy_nebula_sphere))) + #case (2) BGNebula2 #break #case (3) BGNebula3 #break #case (4) BGNebula4 #break + #case (5) BGNebula5 #break #else BGNebula1 #end + translate -galaxy_pattern_origin} + finish {ambient _GX_nebambient diffuse 0 reflection 0 phong 0 specular 0 crand 0} + no_shadow hollow scale galaxy_distance + #ifdef (galaxy_rotate) rotate galaxy_rotate #end + #ifdef (galaxy_origin) translate -galaxy_origin #end } + #declare galaxy_distance = galaxy_distance * 1.001; + #declare _GX_tracelevel = _GX_tracelevel + 1; + global_settings {max_trace_level min(_GX_tracelevel, 30)} + #end #end #version _GX_bgtempver; diff --git a/galaxy/GALAXY.INC b/galaxy/GALAXY.INC new file mode 100644 index 0000000..f1d850a --- /dev/null +++ b/galaxy/GALAXY.INC @@ -0,0 +1,154 @@ +/************************************************************************* + GALAXY INCLUDE FILE FOR PERSISTENCE OF VISION 3.x +************************************************************************** + +Created by Chris Colefax, 1 February 1998 +Updated 9 August 1998: updated for POV-Ray 3.1 + +NOTE: This file requires that Galaxy.bg, Galaxy.obj and Galaxy.sf +be properly installed. See "Galaxy.htm" for more information. + +*************************************************************************/ + +// CHECK VARIABLES AND ASSIGN DEFAULTS +// *********************************** + #declare _GX_tempver = version; #version 3.0; + #ifndef (galaxy_seed) #declare galaxy_seed = 0; #end + #ifndef (galaxy_bg) #declare galaxy_bg = true; #end + #ifndef (galaxy_objects) #declare galaxy_objects = true; #end + #ifndef (galaxy_starfield) #declare galaxy_starfield = true; #end + #ifndef (options_only) #declare options_only = false; #end + #ifndef (debug_options) #declare debug_options = false; #end + + #ifdef (galaxy_colour) #declare _GX_colour = galaxy_colour * <1, 1, 1>; + #else #ifdef (galaxy_color) #declare _GX_colour = galaxy_color * <1, 1, 1>; + #else #declare _GX_colour = <1, 1, 1>; #end #end + #ifdef (galaxy_colouration) #declare _GX_colouration = galaxy_colouration; + #else #ifdef (galaxy_coloration) #declare _GX_colouration = galaxy_coloration; + #else #declare _GX_colouration = .5; #end #end + #ifdef (galaxy_colour_turb) #declare _GX_colourturb = galaxy_colour_turb * <1, 1, 1>; + #else #ifdef (galaxy_color_turb) #declare _GX_colourturb = galaxy_color_turb * <1, 1, 1>; + #else #declare _GX_colourturb = <.2, .2, .2>; #end #end + +// SELECT FIRST GALAXY HUE AND CONVERT TO RGB VALUE +// ************************************************ + #declare _GX_rand = seed(galaxy_seed); + #declare _GX_tempfloat1 = rand(_GX_rand); + #switch (_GX_tempfloat1) + #range (0, .333) #declare galaxy_colour1 = <1, _GX_tempfloat1 * 3, 0>; #break + #range (.333, .444) #declare galaxy_colour1 = <1 - (_GX_tempfloat1 * 9 - 3), 1, 0>; #break + #range (.444, .555) #declare galaxy_colour1 = <0, 1, _GX_tempfloat1 * 9 - 4>; #break + #range (.555, .667) #declare galaxy_colour1 = <0, 1 - (_GX_tempfloat1 * 9 - 4), 1>; #break + #range (.667, .833) #declare galaxy_colour1 = <_GX_tempfloat1 * 6 - 4, 0, 1>; #break + #range (.833, 1) #declare galaxy_colour1 = <1, 0, 1 - (_GX_tempfloat1 * 6 - 5)>; #end + #declare galaxy_colour1 = (1 + ((galaxy_colour1 - .5) * _GX_colouration)) * _GX_colour; + +// SELECT SECOND GALAXY HUE AND CONVERT TO RGB VALUE +// ************************************************* + #declare _GX_tempfloat1 = _GX_tempfloat1 + ((_GX_colourturb.x + _GX_colourturb.y + _GX_colourturb.z) / (rand(_GX_rand) < .5 ? 3 : -3)); + #declare _GX_tempfloat1 = mod(_GX_tempfloat1, 1) + (_GX_tempfloat1 < 0 ? 1 : 0); + #switch (_GX_tempfloat1) + #range (0, .333) #declare galaxy_colour2 = <1, _GX_tempfloat1 * 3, 0>; #break + #range (.333, .444) #declare galaxy_colour2 = <1 - (_GX_tempfloat1 * 9 - 3), 1, 0>; #break + #range (.444, .555) #declare galaxy_colour2 = <0, 1, _GX_tempfloat1 * 9 - 4>; #break + #range (.555, .667) #declare galaxy_colour2 = <0, 1 - (_GX_tempfloat1 * 9 - 4), 1>; #break + #range (.667, .833) #declare galaxy_colour2 = <_GX_tempfloat1 * 6 - 4, 0, 1>; #break + #range (.833, 1) #declare galaxy_colour2 = <1, 0, 1 - (_GX_tempfloat1 * 6 - 5)>; #end + #declare galaxy_colour2 = (.8 + ((galaxy_colour2 - .5) * _GX_colouration)) * _GX_colour; + +// SELECT RANDOM OPTIONS +// ********************* + #declare galaxy_pattern_scale = .6 + (rand(_GX_rand) * .8); + #declare galaxy_pattern_origin = ( - .5) * 50; + #declare galaxy_turb_origin = ( - .5) * 50; + #declare galaxy_star_colouration = rand(_GX_rand) - .5; + #declare _GX_colourturb = _GX_colourturb * _GX_colouration; + +// SELECT RANDOM GALAXY.BG OPTIONS +// ******************************* + #declare galaxy_bgstars = 1 + int(rand(_GX_rand) * 5.99); + #declare galaxy_bgnebula = min(1 + int(rand(_GX_rand) * 10), 6); + #declare galaxy_nebula_sphere = 1 + int(rand(_GX_rand) * 4.99); + #declare galaxy_nebula_ambient = 1 + ( - .5) * _GX_colourturb; + +// SELECT RANDOM GALAXY.OBJ OPTIONS +// ******************************** + #declare _GX_tempfloat1 = rand(_GX_rand) + #if (_GX_tempfloat1 <= .6) + #declare galaxy_cluster_name = concat("Star", str(1 + int(rand(_GX_rand) * 3.99), 0, 0)) + #declare galaxy_cluster_objects = 6 + int(rand(_GX_rand) * 6); + #declare galaxy_cluster_rotate = min(0, mod(rand(_GX_rand) * 90, 15) - 45); + #else #declare galaxy_cluster_name = "" #end + + #declare galaxy_object_scale = 1 + rand(_GX_rand); + #declare galaxy_object_flatten = .1 + rand(_GX_rand) * .5; + #declare galaxy_object_rotate = (rand(_GX_rand) - .5) * 90; + #declare galaxy_cluster_scale = galaxy_object_scale * (.3 + (rand(_GX_rand) * .4)); + + #switch (_GX_tempfloat1) + #range (0, .3) #declare galaxy_object_name = concat("Nebula", str(1 + int(rand(_GX_rand) * 5.3), 0, 0)) #break + #range (.3, .6) #declare galaxy_object_name = concat("Star", str(1 + int(rand(_GX_rand) * 3.99), 0, 0)) #declare galaxy_object_rotate = galaxy_cluster_rotate #break + #range (.6, .8) #declare galaxy_object_name = concat("Comet", str(1 + int(rand(_GX_rand) * 2.99), 0, 0)) #break + #else + #declare galaxy_cluster_name = concat("Meteor", str(1 + int(rand(_GX_rand) * 1.4), 0, 0)) + #declare galaxy_cluster_objects = 4 + int(rand(_GX_rand) * 4); + #declare galaxy_cluster_rotate = (rand(_GX_rand) - .5) * 90; + #declare galaxy_object_name = "" + #end + +// SELECT RANDOM STARFIELD OPTIONS +// ******************************* + #declare star_type = int(rand(_GX_rand) * 2.99) + 1; + #declare star_colour = _GX_colour; + #declare star_colour_turb = _GX_colourturb; + +// WRITE OPTION VALUES TO DEBUG STREAM +// *********************************** + #if (debug_options != false) + #debug concat("// GALAXY INCLUDE FILE OPTIONS (galaxy_seed = ", str(galaxy_seed, 0, 0), ")\r\n") + #debug concat(" #declare galaxy_colour1 = <", str(galaxy_colour1.x, 0, 3), ", ", str(galaxy_colour1.y, 0, 3), ", ", str(galaxy_colour1.z, 0, 3), ">;\r\n") + #debug concat(" #declare galaxy_colour2 = <", str(galaxy_colour2.x, 0, 3), ", ", str(galaxy_colour2.y, 0, 3), ", ", str(galaxy_colour2.z, 0, 3), ">;\r\n") + #debug concat(" #declare galaxy_pattern_scale = ", str(galaxy_pattern_scale, 0, 3), ";\r\n") + #debug concat(" #declare galaxy_pattern_origin = <", str(galaxy_pattern_origin.x, 0, 3), ", ", str(galaxy_pattern_origin.y, 0, 3), ", ", str(galaxy_pattern_origin.z, 0, 3), ">;\r\n") + #debug concat(" #declare galaxy_turb_origin = <", str(galaxy_turb_origin.x, 0, 3), ", ", str(galaxy_turb_origin.y, 0, 3), ", ", str(galaxy_turb_origin.z, 0, 3), ">;\r\n") + #debug concat(" #declare galaxy_star_colouration = ", str(galaxy_star_colouration, 0, 3), ";\r\n") + #debug "\r\n" + #debug concat(" #declare galaxy_bgstars = ", str(galaxy_bgstars, 0, 0), ";\r\n") + #debug concat(" #declare galaxy_bgnebula = ", str(galaxy_bgnebula, 0, 0), ";\r\n") + #debug concat(" #declare galaxy_nebula_sphere = ", str(galaxy_nebula_sphere, 0, 0), ";\r\n") + #debug concat(" #declare galaxy_nebula_ambient = <", str(galaxy_nebula_ambient.x, 0, 3), ", ", str(galaxy_nebula_ambient.y, 0, 3), ", ", str(galaxy_nebula_ambient.z, 0, 3), ">;\r\n") + #debug "\r\n" + #debug concat(" #declare galaxy_object_name = \"", galaxy_object_name, "\"\r\n") + #if (strlen (galaxy_object_name) > 0) + #debug concat(" #declare galaxy_object_scale = ", str(galaxy_object_scale, 0, 3), ";\r\n") + #debug concat(" #declare galaxy_object_flatten = ", str(galaxy_object_flatten, 0, 3), ";\r\n") + #debug concat(" #declare galaxy_object_rotate = ", str(galaxy_object_rotate, 0, 1), ";\r\n") + #end + #debug concat(" #declare galaxy_cluster_name = \"", galaxy_cluster_name, "\"\r\n") + #if (strlen (galaxy_cluster_name) > 0) + #debug concat(" #declare galaxy_cluster_objects = ", str(galaxy_cluster_objects, 0, 0), ";\r\n") + #debug concat(" #declare galaxy_cluster_scale = ", str(galaxy_cluster_scale, 0, 3), ";\r\n") + #debug concat(" #declare galaxy_cluster_rotate = ", str(galaxy_cluster_rotate, 0, 1), ";\r\n") + #end + #debug "\r\n" + #debug concat(" #declare star_type = ", str(star_type, 0, 0), ";\r\n") + #debug concat(" #declare star_colour = <", str(star_colour.x, 0, 3), ", ", str(star_colour.y, 0, 3), ", ", str(star_colour.z, 0, 3), ">;\r\n") + #debug concat(" #declare star_colour_turb = <", str(star_colour_turb.x, 0, 3), ", ", str(star_colour_turb.y, 0, 3), ", ", str(star_colour_turb.z, 0, 3), ">;\r\n") + #debug "\r\n\r\n" + #end + +// CREATE GALAXY BACKGROUND, OBJECTS AND STARFIELD +// *********************************************** + #if (options_only = false) + #if (galaxy_bg != false) #include "GALAXY.BG" #end + #if (galaxy_objects != false) #include "GALAXY.OBJ" #end + #if (galaxy_starfield != false) #include "GALAXY.SF" #end + #end + + #declare galaxy_objects = false; + #declare galaxy_starfield = false; + +// SELECT NEW GALAXY SEED (FOR SUBSQUENT GALAXY.INC INCLUSIONS) +// ************************************************************ + #declare galaxy_seed = (rand(_GX_rand) - .5) * 2e6; + #version _GX_tempver; diff --git a/galaxy/GALAXY.OBJ b/galaxy/GALAXY.OBJ new file mode 100644 index 0000000..de1b190 --- /dev/null +++ b/galaxy/GALAXY.OBJ @@ -0,0 +1,461 @@ +/************************************************************************* + GALAXY OBJECTS FILE FOR PERSISTENCE OF VISION 3.x +************************************************************************** + +Created by Chris Colefax, 1 February 1998 +Updated 9 August 1998: updated for POV-Ray 3.1 + +See "Galaxy.htm" for more information. + +*************************************************************************/ + +// CHECK VARIABLES AND ASSIGN DEFAULTS +// *********************************** + #declare _GX_objtempver = version; #version 3.0; + #ifndef (galaxy_seed) #declare galaxy_seed = 0; #end + #ifndef (galaxy_declare_only) #declare galaxy_declare_only = false; #end + #ifndef (galaxy_distance) #declare galaxy_distance = 1e4; #end + #ifndef (galaxy_pattern_scale) #declare galaxy_pattern_scale = 1; #end + #ifndef (galaxy_pattern_origin) #declare galaxy_pattern_origin = <0, 0, 0>; #end + #ifndef (galaxy_turb_origin) #declare galaxy_turb_origin = <0, 0, 0>; #end + #ifndef (galaxy_intensity) #declare galaxy_intensity = 1; #end + + #ifndef (galaxy_object_name) #declare galaxy_object_name = "Nebula" #end + #ifndef (galaxy_object_scale) #declare galaxy_object_scale = 1; #end + #ifndef (galaxy_object_flatten) #declare galaxy_object_flatten = .2; #end + #ifndef (galaxy_object_rotate) #declare galaxy_object_rotate = 0; #end + #ifndef (galaxy_object_position) #declare galaxy_object_position = <0, 0, 0>; #end + + #ifndef (galaxy_cluster_name) #declare galaxy_cluster_name = "Star" #end + #ifndef (galaxy_cluster_objects) #declare galaxy_cluster_objects = 6; #end + #ifndef (galaxy_cluster_scale) #declare galaxy_cluster_scale = galaxy_object_scale * .5; #end + #ifndef (galaxy_cluster_rotate) #declare galaxy_cluster_rotate = galaxy_object_rotate; #end + #ifndef (galaxy_scale_turb) #declare galaxy_scale_turb = .5; #end + #ifndef (galaxy_rotate_turb) #declare galaxy_rotate_turb = 0; #end + #ifndef (galaxy_cluster_spread) #declare _GX_spread = <15, 15, 0> * galaxy_object_scale; #else #declare _GX_spread = galaxy_cluster_spread * <1, 1, 0>; #end + + #ifdef (galaxy_colour1) #declare _GX_colour1 = galaxy_colour1 * <1, 1, 1>; + #else #ifdef (galaxy_color1) #declare _GX_colour1 = galaxy_color1 * <1, 1, 1>; + #else #declare _GX_colour1 = <1, 1, 1>; #end #end + #ifdef (galaxy_colour2) #declare _GX_colour2 = galaxy_colour2 * <1, 1, 1>; + #else #ifdef (galaxy_color2) #declare _GX_colour2 = galaxy_color2 * <1, 1, 1>; + #else #declare _GX_colour2 = _GX_colour1 - .3; #end #end + #ifdef (galaxy_colour3) #declare _GX_colour3 = galaxy_colour3 * <1, 1, 1>; + #else #ifdef (galaxy_color3) #declare _GX_colour3 = galaxy_color3 * <1, 1, 1>; + #else #declare _GX_colour3 = (_GX_colour1 + _GX_colour2) / 2; #end #end + #ifdef (galaxy_star_colouration) #declare _GX_starcolouration = galaxy_star_colouration; + #else #ifdef (galaxy_star_coloration) #declare _GX_starcolouration = galaxy_star_coloration; + #else #declare _GX_starcolouration = .2; #end #end + #ifdef (galaxy_colour_turb) #declare _GX_colourturb = galaxy_colour_turb * <1, 1, 1>; + #else #ifdef (galaxy_color_turb) #declare _GX_colourturb = galaxy_color_turb * <1, 1, 1>; + #else #declare _GX_colourturb = <.2, .2, .2>; #end #end + + #declare _GX_finaltranslate = galaxy_turb_origin - galaxy_pattern_origin; + #ifndef (_GX_tracelevel) #declare _GX_tracelevel = 5; #end + #if (galaxy_object_flatten > 0) #declare _GX_flatten = <1, 1.01 - mod(galaxy_object_flatten, 1), 1>; + #else #declare _GX_flatten = ; #end + +// CALCULATE STAR COLOURS +// ********************** + #if (_GX_starcolouration = 1) + #declare _GX_starcolour1 = _GX_colour1; + #declare _GX_starcolour2 = _GX_colour2; + #declare _GX_starcolour3 = _GX_colour3; + #else + #declare _GX_tempfloat1 = max(_GX_colour1.x, _GX_colour1.y); #declare _GX_tempfloat1 = max(_GX_tempfloat1, _GX_colour1.z); + #declare _GX_tempfloat2 = min(_GX_colour1.x, _GX_colour1.y); #declare _GX_tempfloat2 = min(_GX_tempfloat2, _GX_colour1.z); + #declare _GX_tempfloat1 = (_GX_tempfloat1 + _GX_tempfloat2) / 2; #declare _GX_starcolour1 = _GX_tempfloat1 + (_GX_colour1 - _GX_tempfloat1) * _GX_starcolouration; + + #declare _GX_tempfloat1 = max(_GX_colour2.x, _GX_colour2.y); #declare _GX_tempfloat1 = max(_GX_tempfloat1, _GX_colour2.z); + #declare _GX_tempfloat2 = min(_GX_colour2.x, _GX_colour2.y); #declare _GX_tempfloat2 = min(_GX_tempfloat2, _GX_colour2.z); + #declare _GX_tempfloat1 = (_GX_tempfloat1 + _GX_tempfloat2) / 2; #declare _GX_starcolour2 = _GX_tempfloat1 + (_GX_colour2 - _GX_tempfloat1) * _GX_starcolouration; + + #declare _GX_tempfloat1 = max(_GX_colour3.x, _GX_colour3.y); #declare _GX_tempfloat1 = max(_GX_tempfloat1, _GX_colour3.z); + #declare _GX_tempfloat2 = min(_GX_colour3.x, _GX_colour3.y); #declare _GX_tempfloat2 = min(_GX_tempfloat2, _GX_colour3.z); + #declare _GX_tempfloat1 = (_GX_tempfloat1 + _GX_tempfloat2) / 2; #declare _GX_starcolour3 = _GX_tempfloat1 + (_GX_colour3 - _GX_tempfloat1) * _GX_starcolouration; + #end + +// START LOOP TO CREATE SINGLE AND CLUSTER OBJECTS +// *********************************************** + #declare _GX_name = strupr(galaxy_object_name) + #declare _GX_objscale = galaxy_object_scale * <1, 1, 1>; + #declare _GX_objloop = 0; #while (_GX_objloop < 2) + #declare _GX_objcreated = false; + #if (strcmp(_GX_name, "-") != 0 & strlen(_GX_name) != 0) + +// SELECT STAR OBJECTS +// ******************* + #if (strcmp(substr(_GX_name, 1, 1), "S") = 0) + #if (strcmp(_GX_name, "STAR") = 0 | strcmp(_GX_name, "STAR1") = 0 | strcmp(_GX_name, "S1") = 0) + #declare _GX_object = disc {0, z, .999 pigment {average pigment_map { + [1 onion color_map { + [.1 rgb _GX_starcolour1 * 8 transmit pow(.05, galaxy_intensity)] [.3 rgb _GX_starcolour3 * 2 transmit pow(.2, galaxy_intensity)] + [.35 rgb _GX_starcolour1 * 3 transmit pow(.1, galaxy_intensity)] [.4 rgb _GX_starcolour3 * 1.5 transmit pow(.2, galaxy_intensity)] + [.7 rgb _GX_starcolour2 transmit pow(.5, galaxy_intensity)] [.71 rgb _GX_starcolour3 * 1.5 transmit pow(.4, galaxy_intensity)] + [.72 rgb _GX_starcolour2 transmit pow(.5, galaxy_intensity)] [1 rgb _GX_starcolour2 transmit 1]} + scallop_wave scale 2] + [1 onion color_map { + [0 rgb _GX_starcolour1 * 2 transmit pow(.05, galaxy_intensity)] [.02 rgb _GX_starcolour2 transmit 1]} + scale <45, 1, 1>] + [1 onion color_map { + [0 rgb _GX_starcolour1 * 2 transmit pow(.05, galaxy_intensity)] [.02 rgb _GX_starcolour2 transmit 1]} + scale <1, 50, 1>]}}} + #declare _GX_objscale = <.2, .2, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "STAR2") = 0 | strcmp(_GX_name, "S2") = 0) + #declare _GX_object = disc {0, z, .999 pigment {average pigment_map { + [1 onion color_map { + [.05 rgb _GX_starcolour1 * 8 transmit pow(.05, galaxy_intensity)] [.2 rgb _GX_starcolour3 * 3 transmit pow(.3, galaxy_intensity)] + [1 rgb _GX_starcolour2 transmit 1]} scallop_wave scale 2] + [1 onion color_map {[0 rgb _GX_starcolour1 * 4 transmit pow(.05, galaxy_intensity)] [.02 rgb _GX_starcolour2 transmit 1]} + scale <45, 1, 1>] + [1 onion color_map {[0 rgb _GX_starcolour1 * 4 transmit pow(.05, galaxy_intensity)] [.02 rgb _GX_starcolour2 transmit 1]} + scale <1, 50, 1>]}}} + #declare _GX_objscale = <.2, .2, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "STAR3") = 0 | strcmp(_GX_name, "S3") = 0) + #declare _GX_object = disc {0, z, .999 pigment {average pigment_map { + [1 onion color_map { + [.15 rgb _GX_starcolour1 * 8 transmit pow(.05, galaxy_intensity)] [.4 rgb _GX_starcolour3 * 3 transmit pow(.1, galaxy_intensity)] + [.49 rgb _GX_starcolour3 * 1.5 transmit pow(.3, galaxy_intensity)] [.5 rgb _GX_starcolour1 * 2 transmit pow(.1, galaxy_intensity)] + [.51 rgb _GX_starcolour3 transmit pow(.3, galaxy_intensity)] [1 rgb _GX_starcolour2 transmit 1]} + scallop_wave scale 2] + [1 onion color_map {[0 rgb _GX_starcolour1 * 2 transmit pow(.05, galaxy_intensity)] [.01 rgb _GX_starcolour2 transmit 1]} + scale <90, 1, 1>] + [1 onion color_map {[0 rgb _GX_starcolour1 * 2 transmit pow(.05, galaxy_intensity)] [.01 rgb _GX_starcolour2 transmit 1]} + scale <1, 100, 1>]}}} + #declare _GX_objscale = <.2, .2, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "STAR4") = 0 | strcmp(_GX_name, "S4") = 0) + #declare _GX_object = disc {0, z, .999 pigment {average pigment_map { + [1 onion color_map { + [.05 rgb _GX_starcolour1 * 10 transmit pow(.05, galaxy_intensity)] [.2 rgb _GX_starcolour3 * 3 transmit pow(.3, galaxy_intensity)] + [1 rgb _GX_starcolour2 transmit 1]} scallop_wave scale 2] + [1 onion color_map {[0 rgb _GX_starcolour1 transmit pow(.8, galaxy_intensity)] [.06 rgb _GX_starcolour2 transmit 1]} + scale <16, 1, 1>] + [1 onion color_map {[0 rgb _GX_starcolour1 transmit pow(.8, galaxy_intensity)] [.06 rgb _GX_starcolour2 transmit 1]} + scale <16, 1, 1> rotate z * 120] + [1 onion color_map {[0 rgb _GX_starcolour1 transmit pow(.8, galaxy_intensity)] [.06 rgb _GX_starcolour2 transmit 1]} + scale <16, 1, 1> rotate z * 240]}}} + #declare _GX_objscale = <.2, .2, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + #end + +// SELECT GALAXY OBJECTS +// ********************* + #if (strcmp(substr(_GX_name, 1, 1), "G") = 0) + #if (strcmp(_GX_name, "GALAXY") = 0 | strcmp(_GX_name, "GALAXY1") = 0 | strcmp(_GX_name, "G1") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] + [.2 wrinkles color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)]} + scale .06 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.4 spiral1 2 pigment_map { + [.3 wrinkles color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)]} + scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [1 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)]} + scale .15 translate -galaxy_turb_origin warp {turbulence .06 octaves 4 lambda 3} translate galaxy_turb_origin] + [.8 spiral1 6 pigment_map { + [.1 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.2, galaxy_intensity)] [1 rgb _GX_colour2 transmit pow(.8, galaxy_intensity)]} + scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.8 rgb _GX_colour2 transmit pow(.8, galaxy_intensity)]} + scale .13 translate -galaxy_turb_origin warp {turbulence .06 octaves 4 lambda 3} translate galaxy_turb_origin] + [.9 spiral1 12 pigment_map { + [0 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.3, galaxy_intensity)] [.8 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)]} + scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.6 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)]} + scale .09 translate -galaxy_turb_origin warp {turbulence .06 octaves 4 lambda 3} translate galaxy_turb_origin] + [1 rgb _GX_colour2 transmit 1]} + scallop_wave scale 2}} + #declare _GX_objscale = <.25, .25, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "GALAXY2") = 0 | strcmp(_GX_name, "G2") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [0 rgb _GX_colour1 transmit pow(.05, galaxy_intensity)] + [.4 wrinkles color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.7, galaxy_intensity)]} + scale .08 * galaxy_pattern_scale translate -galaxy_turb_origin warp {turbulence .08 octaves 4 lambda 4} translate _GX_finaltranslate] + [.65 spiral1 2 pigment_map { + [0 wrinkles color_map {[0 rgb _GX_colour1 transmit pow(.2, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.7, galaxy_intensity)]} + scale .25 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [1 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.5, galaxy_intensity)] [.6 rgb _GX_colour3 transmit pow(.9, galaxy_intensity)]} + scale .15 * galaxy_pattern_scale translate -galaxy_pattern_origin]} + sine_wave scale .2 translate -galaxy_turb_origin warp {turbulence -.08 octaves 4 lambda 4} translate galaxy_turb_origin] + [.85 spiral1 2 pigment_map { + [0 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)] [.8 rgb _GX_colour2 transmit pow(.8, galaxy_intensity)]} + scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.8 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)]} + sine_wave scale .15 translate -galaxy_turb_origin warp {turbulence .05 octaves 4 lambda 4} translate galaxy_turb_origin] + [1 rgb _GX_colour2 transmit 1]} + scallop_wave scale 2}} + #declare _GX_objscale = <.25, .25, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "GALAXY3") = 0 | strcmp(_GX_name, "G3") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [.03 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] + [.25 spiral1 -2 pigment_map { + [0 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.9, galaxy_intensity)] [.6 rgb _GX_colour1 transmit pow(.4, galaxy_intensity)]} scale .1 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.1 wrinkles color_map {[0 rgb _GX_colour1 transmit pow(.3, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.5, galaxy_intensity)]} scale .3 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.9 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.5, galaxy_intensity)] [1 rgb _GX_colour1 transmit pow(.8, galaxy_intensity)]} scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin]} + scale .4 translate -galaxy_turb_origin warp {turbulence .04 octaves 4 lambda 3 omega .5} translate galaxy_turb_origin] + [.5 spiral1 -2 pigment_map { + [0 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.1, galaxy_intensity)] [.5 rgb _GX_colour2 transmit pow(.5, galaxy_intensity)]} scale .1 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.3 wrinkles color_map {[0 rgb _GX_colour2 transmit pow(.3, galaxy_intensity)] [1 rgb _GX_colour2 transmit pow(.4, galaxy_intensity)]} scale .3 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [1 wrinkles color_map {[0 rgb _GX_colour2 transmit pow(.7, galaxy_intensity)] [1 rgb _GX_colour2 transmit 1]} scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin]} + scale .8 translate -galaxy_turb_origin warp {turbulence .1 octaves 4 lambda 3 omega .4} translate galaxy_turb_origin] + [1 rgb _GX_colour2 transmit 1]}}} + #declare _GX_objscale = <.25, .25, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "GALAXY4") = 0 | strcmp(_GX_name, "G4") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] + [.4 spiral1 -2 pigment_map { + [0 wrinkles color_map {[.2 rgb _GX_colour3 transmit pow(.7, galaxy_intensity)] [1 rgb _GX_colour1 transmit pow(.2, galaxy_intensity)]} scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.4 wrinkles color_map {[.4 rgb _GX_colour3 transmit pow(.8, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)]} scale .1 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.9 wrinkles color_map {[0 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.8, galaxy_intensity)]} scale .3 * galaxy_pattern_scale translate -galaxy_pattern_origin]} + scale 1.2 translate -galaxy_turb_origin warp {turbulence .04 octaves 4 lambda 3} translate galaxy_turb_origin] + [.6 spiral1 -2 pigment_map { + [0 wrinkles color_map {[.3 rgb _GX_colour3 transmit pow(.8, galaxy_intensity)] [1 rgb _GX_colour1 transmit pow(.3, galaxy_intensity)]} scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.3 wrinkles color_map {[.5 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.5, galaxy_intensity)]} scale .1 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.8 wrinkles color_map {[0 rgb _GX_colour2 transmit 1] [1 rgb _GX_colour2 transmit pow(.8, galaxy_intensity)]} scale .3 * galaxy_pattern_scale translate -galaxy_pattern_origin]} + scale .8 translate -galaxy_turb_origin warp {turbulence .03 octaves 4 lambda 3} translate galaxy_turb_origin] + [1 rgb _GX_colour2 transmit 1]}}} + #declare _GX_objscale = <.25, .25, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "GALAXY5") = 0 | strcmp(_GX_name, "G5") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] + [.35 granite color_map { + [0 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)] [.8 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)]} + scale .06 * galaxy_pattern_scale translate _GX_finaltranslate] + [.6 granite color_map { + [.3 rgb _GX_colour2 transmit pow(.7, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.2, galaxy_intensity)]} + scale .05 * galaxy_pattern_scale translate _GX_finaltranslate] + [.75 granite color_map { + [.5 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)] [1 rgb _GX_colour2 transmit pow(.3, galaxy_intensity)]} + scale .04 * galaxy_pattern_scale translate _GX_finaltranslate] + [1 rgb _GX_colour2 transmit 1]} + scallop_wave scale 2}} + #declare _GX_objscale = <.25, .25, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + #end + +// SELECT NEBULA OBJECTS +// ********************* + #if (strcmp(substr(_GX_name, 1, 1), "N") = 0) + #if (strcmp(_GX_name, "NEBULA") = 0 | strcmp(_GX_name, "NEBULA1") = 0 | strcmp(_GX_name, "N1") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [.2 granite color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)]} scale 2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.8 granite color_map {[0 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)] [.5 rgb _GX_colour2 transmit pow(.95, galaxy_intensity)]} scale galaxy_pattern_scale translate -galaxy_pattern_origin] + [.9 rgb _GX_colour2 transmit 1]} + scallop_wave scale 2.2 + translate -galaxy_turb_origin warp {turbulence .35 octaves 4 omega .4 lambda 3} translate galaxy_turb_origin}} + #declare _GX_objscale = <.3, .3, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "NEBULA2") = 0 | strcmp(_GX_name, "N2") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [0 wrinkles color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)]} + warp {turbulence .5 octaves 2} scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.8 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.5, galaxy_intensity)] [.5 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)]} + warp {turbulence .5 octaves 2} scale .18 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.9 rgbt _GX_colour2 transmit 1]} + scallop_wave scale 2.2 + translate -galaxy_turb_origin warp {turbulence .2 octaves 2 lambda 3 omega .6} translate galaxy_turb_origin}} + #declare _GX_objscale = <.3, .3, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "NEBULA3") = 0 | strcmp(_GX_name, "N3") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [0 granite color_map {[.05 rgb _GX_colour3 transmit 1] [.3 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)]} + scale .7 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.8 wrinkles color_map {[0 rgb _GX_colour2 transmit 1] [1 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)]} + scale .1 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.9 rgbt _GX_colour2 transmit 1]} + scallop_wave scale 2.2 + translate -galaxy_turb_origin warp {turbulence .25 octaves 4 lambda 3 omega .4} translate galaxy_turb_origin}} + #declare _GX_objscale = <.3, .3, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "NEBULA4") = 0 | strcmp(_GX_name, "N4") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [.2 wrinkles color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.9, galaxy_intensity)]} scale .1 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.5 granite color_map {[0 rgb _GX_colour1 transmit pow(.3, galaxy_intensity)] [.6 rgb _GX_colour3 transmit pow(.95, galaxy_intensity)]} scale .4 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.8 granite color_map {[0 rgb _GX_colour3 transmit pow(.6, galaxy_intensity)] [.3 rgb _GX_colour2 transmit 1]} scale .3 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.9 rgb _GX_colour2 transmit 1]} + scallop_wave scale 2.2 + translate -galaxy_turb_origin warp {turbulence .25 octaves 4 omega .4 lambda 3} translate galaxy_turb_origin}} + #declare _GX_objscale = <.3, .3, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "NEBULA5") = 0 | strcmp(_GX_name, "N5") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [.5 wrinkles color_map {[.1 rgb _GX_colour2 transmit 1] [.4 rgb _GX_colour3 transmit pow(.5, galaxy_intensity)] [.8 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)]} scale .1 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.8 wrinkles color_map {[.5 rgb _GX_colour2 transmit 1] [1 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)]} scale .1 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.9 rgb _GX_colour2 transmit 1]} + scallop_wave scale 2.3 + translate -galaxy_turb_origin warp {turbulence .3 octaves 4 omega .3 lambda 5} translate galaxy_turb_origin}} + #declare _GX_objscale = <.2, .2, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "NEBULA6") = 0 | strcmp(_GX_name, "N6") = 0) + #declare _GX_object = disc {0, z, .999 pigment {onion pigment_map { + [.4 wrinkles color_map {[0 rgb _GX_colour2 transmit pow(.7, galaxy_intensity)] [1 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)]} scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.5 wrinkles pigment_map { + [0 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)] [1 rgb _GX_colour2 transmit pow(.8, galaxy_intensity)]} scale .5] + [1 wrinkles color_map {[0 rgb _GX_colour3 transmit pow(.8, galaxy_intensity)] [1 rgb _GX_colour2 transmit pow(.95, galaxy_intensity)]} scale .5]} + scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.7 wrinkles pigment_map { + [0 granite color_map {[0 rgb _GX_colour1 transmit pow(.2, galaxy_intensity)] [1 rgb _GX_colour1 transmit pow(.6, galaxy_intensity)]}] + [1 granite color_map {[0 rgb _GX_colour3 transmit pow(.8, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.95, galaxy_intensity)]}]} + scale .2 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.85 granite color_map {[0 rgb _GX_colour3 transmit pow(.8, galaxy_intensity)] [.4 rgb _GX_colour3 transmit 1]} scale .4 * galaxy_pattern_scale translate -galaxy_pattern_origin] + [.9 rgb _GX_colour1 transmit 1]} + scallop_wave scale 2.5 + translate -galaxy_turb_origin warp {turbulence .04 octaves 4 omega .8 lambda 3} translate galaxy_turb_origin}} + #declare _GX_objscale = <.15, .15, 1> * _GX_objscale; #declare _GX_objcreated = true; #end + #end + +// SELECT COMET OBJECTS +// ******************** + #if (strcmp(substr(_GX_name, 1, 1), "C") = 0) + #if (strcmp(_GX_name, "COMET") = 0 | strcmp(_GX_name, "COMET1") = 0 | strcmp(_GX_name, "C1") = 0) + #declare _GX_object = disc {<.5, 0, 0>, z, .499 pigment {onion pigment_map { + [.03 onion color_map {[.03 rgb _GX_colour1 transmit pow(.05, galaxy_intensity)] [.05 rgb _GX_colour3 transmit 1]} translate <.05, 0, 0>] + [.06 radial color_map {[.1 rgb _GX_colour1 transmit pow(.05, galaxy_intensity)] [.25 rgb _GX_colour2 transmit 1]} triangle_wave] + [.4 radial pigment_map { + [.05 wrinkles color_map {[0 rgb _GX_colour2 transmit 1] [1 rgb _GX_colour3 transmit pow(.1, galaxy_intensity)]} + scale galaxy_pattern_scale translate -galaxy_turb_origin warp {turbulence 2 octaves 3 lambda 2} translate _GX_finaltranslate] + [.25 rgb _GX_colour2 transmit 1]} triangle_wave] + [.8 rgb _GX_colour2 transmit 1]} rotate x * 90} + scale <1.05, .35, 1> translate <-.05, 0, 0>} + #declare _GX_objscale = <.5, .5, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "COMET2") = 0 | strcmp(_GX_name, "C2") = 0) + #declare _GX_object = disc {<.5, 0, 0>, z, .499 pigment {onion pigment_map { + [.03 onion color_map {[.03 rgb _GX_colour1 transmit pow(.05, galaxy_intensity)] [.05 rgb _GX_colour3 transmit 1]} translate <.05, 0, 0>] + [.06 radial color_map {[.1 rgb _GX_colour1 transmit pow(.05, galaxy_intensity)] [.25 rgb _GX_colour2 transmit 1]} triangle_wave] + [.2 radial pigment_map { + [.1 granite color_map {[0 rgb _GX_colour3 transmit pow(.2, galaxy_intensity)] [1 rgb _GX_colour2 transmit 1]} scale galaxy_pattern_scale translate _GX_finaltranslate] + [.2 rgb _GX_colour2 transmit 1]} translate -galaxy_turb_origin warp {turbulence .03 lambda 3 octaves 3 omega .9} translate galaxy_turb_origin + triangle_wave] + [.6 radial pigment_map { + [.1 granite color_map {[0 rgb _GX_colour3 transmit pow(.8, galaxy_intensity)] [.6 rgb _GX_colour2 transmit 1]} scale .4 * galaxy_pattern_scale translate _GX_finaltranslate] + [.2 rgb _GX_colour2 transmit 1]} translate -galaxy_turb_origin warp {turbulence .1 lambda 3 octaves 3 omega .9} translate galaxy_turb_origin + triangle_wave] + [.8 rgb _GX_colour2 transmit 1]} rotate x * 90} + scale <1.05, .4, 1> translate <-.05, 0, 0>} + #declare _GX_objscale = <.5, .5, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "COMET3") = 0 | strcmp(_GX_name, "C3") = 0) + #declare _GX_object = disc {<.5, 0, 0>, z, .499 pigment {average pigment_map { + [1 onion color_map {[.006 rgb _GX_colour1 * 3 transmit pow(.05, galaxy_intensity)] [.02 rgb _GX_colour3 transmit 1]} + scale <1.5, 1, 1> rotate z * 30 translate <.05, 0, 0>] + [1 onion pigment_map { + [.05 rgb _GX_colour3 transmit 1] + [.1 spiral1 1 color_map {[.03 rgb _GX_colour1 * 3 transmit pow(.05, galaxy_intensity)] [.07 rgb _GX_colour3 transmit 1]} scale 4] + [.3 spiral1 1 color_map {[.03 rgb _GX_colour3 * 2 transmit pow(.1, galaxy_intensity)] [.07 rgb _GX_colour2 transmit 1]} scale 4] + [.6 spiral1 1 pigment_map { + [0 granite color_map {[0 rgb _GX_colour3 * 2 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour2 transmit pow(.4, galaxy_intensity)]} + scale <.2, .03, .03> * galaxy_pattern_scale rotate z * 50 translate _GX_finaltranslate] + [.08 rgb _GX_colour2 transmit 1]} scale 4] + [.85 spiral1 1 pigment_map { + [0 granite color_map {[0 rgb _GX_colour2 transmit pow(.4, galaxy_intensity)] [1 rgb _GX_colour2 transmit pow(.7, galaxy_intensity)]} + scale <.2, .03, .03> * galaxy_pattern_scale rotate z * 35 translate _GX_finaltranslate] + [.1 rgb _GX_colour2 transmit 1]} scale 4] + [.98 rgb _GX_colour2 transmit 1]} + scallop_wave scale 2 rotate z * 125 translate <.02, -.02, 0>]} + scale <1, 2, 1>} + scale <1.05, .6, 1> translate <-.05, 0, 0>} + #declare _GX_objscale = <.5, .5, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + #end + +// SELECT METEOR OBJECTS +// ********************* + #if (strcmp(substr(_GX_name, 1, 1), "M") = 0) + #if (strcmp(_GX_name, "METEOR") = 0 | strcmp(_GX_name, "METEOR1") = 0 | strcmp(_GX_name, "M1") = 0) + #declare _GX_object = disc {<.5, 0, 0>, z, .499 pigment {gradient x pigment_map { + [.1 onion color_map {[.03 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [.05 rgb _GX_colour3 transmit 1]} translate <.1, 0, 0>] + [.12 onion color_map {[.02 rgb _GX_colour1 transmit pow(.2, galaxy_intensity)] [.05 rgb _GX_colour3 transmit 1]} + scale <18, 1, 1> translate <.1, 0, 0>] + [.5 onion pigment_map { + [0 granite color_map {[0 rgb _GX_colour3 transmit pow(.3, galaxy_intensity)] [1 rgb _GX_colour2 transmit 1]} scale .2 * galaxy_pattern_scale translate _GX_finaltranslate] + [.05 rgb _GX_colour2 transmit 1]} + scale <18, 1, 1> translate <.1, 0, 0> translate -galaxy_turb_origin warp {turbulence .02 octaves 3 lambda 4} translate galaxy_turb_origin]} + scale <1, 5, 1>} + scale <1.1, .1, 1> translate <-.1, 0, 0>} + #declare _GX_objscale = <.5, .5, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + + #if (strcmp(_GX_name, "METEOR2") = 0 | strcmp(_GX_name, "M2") = 0) + #declare _GX_object = disc {<.5, 0, 0>, z, .499 pigment {gradient x pigment_map { + [.1 onion pigment_map { + [.03 granite color_map {[0 rgb _GX_colour1 transmit pow(.05, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)]} scale <.3, .15, .1> * galaxy_pattern_scale translate _GX_finaltranslate] + [.05 rgb _GX_colour2 transmit 1]} + translate <.1, 0, 0>] + [.12 onion pigment_map { + [.02 granite color_map {[0 rgb _GX_colour1 transmit pow(.1, galaxy_intensity)] [1 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)]} scale <.02, .15, .1> * galaxy_pattern_scale translate _GX_finaltranslate] + [.04 granite color_map {[0 rgb _GX_colour3 transmit pow(.2, galaxy_intensity)] [.7 rgb _GX_colour2 transmit 1]} scale <.015, .1, .1> * galaxy_pattern_scale translate _GX_finaltranslate] + [.05 rgb _GX_colour2 transmit 1]} + scale <18, 1, 1> translate <.1, 0, 0> + translate -galaxy_turb_origin warp {turbulence .02 octaves 4 omega .6 lambda 4} translate galaxy_turb_origin] + [.5 onion pigment_map { + [0 granite color_map {[0 rgb _GX_colour3 transmit pow(.4, galaxy_intensity)] [.7 rgb _GX_colour2 transmit pow(.9, galaxy_intensity)]} scale <.015, .1, .1> * galaxy_pattern_scale translate _GX_finaltranslate] + [.05 rgb _GX_colour2 transmit 1]} + scale <18, 1, 1> translate <.1, 0, 0> translate -galaxy_turb_origin warp {turbulence .04 octaves 4 omega .4 lambda 4} translate galaxy_turb_origin]} + scale <1, 5, 1>} + scale <1.1, .2, 1> translate <-.1, 0, 0>} + #declare _GX_objscale = <.5, .5, 1> * _GX_objscale * _GX_flatten; #declare _GX_objcreated = true; #end + #end + +// POSITION SINGLE OBJECT +// ********************** + #switch (_GX_objloop) + #case (0) #if (_GX_objcreated = false) + #warning "You specified an incorrect galaxy_object_name!\r\n" + #else + #declare galaxy_object = object {_GX_object + finish {ambient 1 diffuse 0 reflection 0 phong 0 specular 0 crand 0} + scale _GX_objscale rotate z * galaxy_object_rotate + no_shadow hollow} + + #if (galaxy_declare_only = false) object {galaxy_object + translate z rotate <-1, 1, 0> * galaxy_object_position + scale galaxy_distance + #ifdef (galaxy_rotate) rotate galaxy_rotate #end + #ifdef (galaxy_origin) translate -galaxy_origin #end } + #declare galaxy_distance = galaxy_distance * (sqrt(1 + pow(max(_GX_objscale.x, _GX_objscale.y), 2)) + .001); + #declare _GX_tracelevel = _GX_tracelevel + 1; + global_settings {max_trace_level min(_GX_tracelevel, 30)} + #end + #end #break + +// POSITION CLUSTER OBJECTS +// ************************ + #case (1) #if (_GX_objcreated = false) + #warning "You specified an incorrect galaxy_cluster_name!\r\n" + #else + #declare galaxy_cluster_object = object {_GX_object + finish {ambient 1 diffuse 0 reflection 0 phong 0 specular 0 crand 0} + scale _GX_objscale rotate z * galaxy_cluster_rotate + no_shadow hollow} + + #if (galaxy_declare_only = false & galaxy_cluster_objects >= 1) + #declare _GX_objrand = seed(galaxy_seed); + union { #declare _GX_objcount = 0; #while (_GX_objcount < galaxy_cluster_objects) + object {galaxy_cluster_object + finish {ambient 1 + (( - .5) * _GX_colourturb)} + #declare _GX_clusterscale = 1 + ((rand(_GX_objrand) - .5) * galaxy_scale_turb * 2); + scale _GX_clusterscale + rotate z * (rand(_GX_objrand) - .5) * galaxy_rotate_turb + translate z + rotate ( - .5) * _GX_spread + <-1, 1, 0> * galaxy_object_position + scale galaxy_distance} + #declare _GX_objscale2 = _GX_clusterscale * _GX_objscale; + #declare galaxy_distance = galaxy_distance * (sqrt(1 + pow(max(_GX_objscale2.x, _GX_objscale2.y), 2)) + .001); + #declare _GX_tracelevel = _GX_tracelevel + 1; + #declare _GX_objcount = _GX_objcount + 1; #end + #ifdef (galaxy_rotate) rotate galaxy_rotate #end + #ifdef (galaxy_origin) translate -galaxy_origin #end } + global_settings {max_trace_level min(_GX_tracelevel, 30)} + #end + #end + #end + +// LOOP THROUGH FILE TO SELECT CLUSTER OBJECT +// ****************************************** + #end + #declare _GX_name = strupr(galaxy_cluster_name) + #declare _GX_objscale = galaxy_cluster_scale * <1, 1, 1>; + #declare _GX_objloop = _GX_objloop + 1; #end + #version _GX_objtempver; diff --git a/galaxy/GALAXY.SF b/galaxy/GALAXY.SF new file mode 100644 index 0000000..cfa9c5c --- /dev/null +++ b/galaxy/GALAXY.SF @@ -0,0 +1,75 @@ +/************************************************************************* + GALAXY STARFIELD FILE FOR PERSISTENCE OF VISION 3.x +************************************************************************** + +Created by Chris Colefax, 1 February 1998 +Updated 9 August 1998: updated for POV-Ray 3.1 + +See "Galaxy.htm" for more information. + +*************************************************************************/ + +// CHECK VARIABLES AND ASSIGN DEFAULTS +// *********************************** + #declare _SF_tempver = version; #version 3.0; + #ifndef (galaxy_seed) #declare galaxy_seed = 0; #end + #ifndef (star_count) #declare star_count = 1000; #end + #ifndef (star_type) #declare star_type = 1; #end + #ifndef (star_scale) #declare star_scale = 1; #end + #ifndef (star_spread) #declare star_spread = 1; #end + #ifndef (star_distribution) #declare star_distribution = 1; #end + #ifndef (star_brightness_turb) #declare star_brightness_turb = .5; #end + #ifndef (star_distance) #ifdef (galaxy_distance) #declare star_distance = galaxy_distance * 2; + #else #declare star_distance = 2e4; #end #end + + #ifdef (star_colour) #declare _SF_colour = star_colour * <1, 1, 1>; + #else #ifdef (star_color) #declare _SF_colour = star_color * <1, 1, 1>; + #else #declare _SF_colour = <.9, .9, .9>; #end #end + #ifdef (star_colour_turb) #declare _SF_colourturb = star_colour_turb * <1, 1, 1>; + #else #ifdef (star_color_turb) #declare _SF_colourturb = star_color_turb * <1, 1, 1>; + #else #ifdef (_GX_colourturb) #declare _SF_colourturb = _GX_colourturb; + #else #declare _SF_colourturb = <.2, .2, .2>; #end #end #end + +// SELECT STAR PIGMENT +// ******************* + #switch (star_type) + #case (2) #declare _SF_starpigment = pigment {onion color_map { + [.3 rgb 1] [.8 rgbt 1] [.9 rgbt <1, 1, 1, .7>] [1 rgbt 1]} + scallop_wave scale 2} + #declare _SF_starobjscale = .015; #break + #case (3) #declare _SF_starpigment = pigment {onion pigment_map { + [.1 rgb 1] + [.4 average pigment_map { + [1 onion color_map {[.04 rgb 3] [.1 rgbt 1]} scale <10, 1, 1>] + [1 onion color_map {[.04 rgb 3] [.1 rgbt 1]} scale <10, 1, 1> rotate z * 120] + [1 onion color_map {[.04 rgb 3] [.1 rgbt 1]} scale <10, 1, 1> rotate z * 240]} + scale .5]} + scallop_wave scale 2} + #declare _SF_starobjscale = .025; #break + #else #declare _SF_starpigment = pigment {onion color_map { + [.3 rgb <1, 1, 1>] [1 rgbt <1, 1, 1, 1>]}} + #declare _SF_starobjscale = .01; #end + + #declare _SF_starobject = triangle {<-1, -.6, 0>, <0, 1, 0>, <1, -.6, 0> + pigment {onion pigment_map {[.25 _SF_starpigment scale .25] [.25 rgbt <1, 1, 1, 1>]} scale 2} + finish {ambient 1 diffuse 0 reflection 0 phong 0 specular 0 crand 0} + scale star_scale * _SF_starobjscale} + +// CREATE STAR FIELD +// ***************** + #declare _SF_rand = seed(galaxy_seed); + #declare _SF_stars = union { #declare _SF_count = 0; #while (_SF_count < 50) + object {_SF_starobject + finish {ambient _SF_colour * (1 + (rand(_SF_rand) - .5) * star_brightness_turb * 2) * (1 + * _SF_colourturb)} + translate z * (1 + pow(rand(_SF_rand), star_distribution) * star_spread) + rotate * 360} + #declare _SF_count = _SF_count + 1; #end } + + union { #declare _SF_count = 0; #while (_SF_count < star_count / 50) + object {_SF_stars rotate * 360} + #declare _SF_count = _SF_count + 1; #end + no_shadow hollow scale star_distance + #ifdef (galaxy_rotate) rotate galaxy_rotate #end + #ifdef (galaxy_origin) translate -galaxy_origin #end } + + #version _SF_tempver; diff --git a/galaxy/Galaxy.htm b/galaxy/Galaxy.htm new file mode 100644 index 0000000..fc0d8a7 --- /dev/null +++ b/galaxy/Galaxy.htm @@ -0,0 +1,865 @@ +Galaxy Include File + + + +
+GALAXY INCLUDE FILE for Persistence of Vision 3.x +
+ + +

Created by Chris Colefax, 1 February 1998 +
Updated 9 August 1998: updated for POV-Ray 3.1 +
+ +


+ +

INSTALLATION +

QUICK START +

UNDERSTANDING THE DIFFERENT GALAXY.* FILES +

GALAXY OPTIONS +

+

TROUBLESHOOTING +

COPYRIGHT AND LEGAL INFORMATION +

CONTACTING THE AUTHOR + +

+
+
+INSTALLATION +
+The Galaxy Include File package consists of four files (Galaxy.inc, +Galaxy.bg, Galaxy.obj and Galaxy.sf) which work separately and together, +depending on the desired effect. All four files should be copied to +one of the directories (folders) in your POV-Ray library path. Normally +this is the INCLUDE sub-directory of the directory where you installed +POV-Ray, so if you installed POV-Ray in C:\POVRAY you should copy the files +to C:\POVRAY\INCLUDE. On a Windows 95 system, this is probably something +like: + +

C:\Program Files\POV-Ray for Windows\Include + +

On UNIX and similar systems, where filenames are case-sensitive, you may +have to rename the four include files so that the filenames are all uppercase. +This will enable you to render the sample files without modification. + + +

+
+
+QUICK START +
+The Galaxy Include File package allows you to create a variety of outer- +space scenes which can be used on their own or as backgrounds to other +scenes and animations. In addition to spiral galaxies, the Galaxy Include +File package can also create starfields, star clusters, nebulae, comets, +and meteor showers. You can easily create a galaxy scene containing a +selection of these elements by adding the following lines to a POV-Ray +scene file: + +

#declare galaxy_seed = 123456789; +
#include "GALAXY.INC"
+ +

You can choose any positive or negative integer you like for the +galaxy_seed value. When you render this scene, the Galaxy Include File +will select random options, and then use Galaxy.bg, Galaxy.obj, and +Galaxy.sf to create the galaxy scene. In addition to changing the seed +number, you can use a variety of options to modify the galaxy scene. +To use any of these options just add the following line to your scene file, +before including Galaxy.inc: + +

#declare [variable-name] = [value] + +

substituting the desired variable name and value where appropriate. +Note that Galaxy.inc (or any of the Galaxy.* files) should never be +included at the start of a scene (like colors.inc or textures.inc). +They should only be included after declaring the desired galaxy options. + +

As well as creating random galaxy scenes using Galaxy.inc, you can use +Galaxy.bg, Galaxy.obj, and/or Galaxy.sf separately to build custom galaxy +scenes piece by piece. You can include any of the four Galaxy.* files as +many times as you want in a single POV-Ray scene, declaring separate options +for each Galaxy.* inclusion. Note that you don't have to redeclare any +options that are common to any or all of the Galaxy.* files, eg: + +

// COMMON GALAXY OPTIONS +
#declare galaxy_colour1 = < 1.3, 1.2, .8> ; +
#declare galaxy_colour2 = < 1, .5, .3 > ; +
#declare galaxy_rotate = < 90, 180, 0> ; + +

// GALAXY BACKGROUND +
#declare galaxy_bgstars = 4; +
#declare galaxy_bgnebula = off; +
#declare galaxy_nebula_sphere = 5; +
#include "GALAXY.BG" + +

// GALAXY OBJECTS +
#declare galaxy_object_name = "Nebula3" +
#declare galaxy_cluster_name = "Star4" +
#include "GALAXY.OBJ" + +
#declare galaxy_object_name = "Comet2" +
#declare galaxy_cluster_name = "" +
#include "GALAXY.OBJ"
+ +

In the above example the same colours and rotation are applied to each +element of the galaxy scene, without having to redeclare them each time +you include one of the Galaxy.* files. + + +

+
+
+UNDERSTANDING THE DIFFERENT GALAXY.* FILES +
+As mentioned above, the four different files of the Galaxy Include File +package can be used in a variety of ways, depending on how you wish to +create your galaxy scene. The files are: + +

The Galaxy Backgrounds File (GALAXY.BG): this include file is used to +create a selection of starfield and nebula pigments (including a Milky Way +pigment), which can either be mapped directly to the sky_sphere, or to an +actual sphere object. Although Galaxy.bg allows you to create backgrounds +quite easily, the file gives you little control over the exact shape of the +nebulae, and the starfields are not suitable for anti-aliasing or +animations in which the camera is moved or altered in some way. + +

The Galaxy Starfield File (GALAXY.SF): this include file is used to create +starfields consisting of actual objects, rather than textures. Because of +this, the starfields can be anti-aliased and animated very well, and +improved programming means that the parsing takes about one fifth of the +time needed for previous versions of the Starfield Include File. Galaxy.sf +can create three different types of stars, and can be used in conjunction +with Galaxy.bg to create stars larger than one pixel in size. + +

The Galaxy Objects File (GALAXY.OBJ): this include file is used to create +and position a selection of outer-space objects, including four different +feature stars, six different nebulae, five different galaxies, three +different comets, and two different meteors. The objects can be positioned +individually, or in random clusters (eg. star clusters or meteor showers). + +

The Galaxy Include File (GALAXY.INC): this include file uses the above three +files to create random galaxy scenes. Galaxy.inc selects random options for +the other files, including colours, object types, scaling, rotation, etc., +and can automatically include the other files into your POV-Ray scene, making +it quick and easy to use the Galaxy Include File package without having to +declare separate options for each of the Galaxy.* files. + + +

+
+
+GALAXY OPTIONS +
+This section explains the various options that can be used with Galaxy.inc, +as well as the options that can be used separately with Galaxy.bg, +Galaxy.obj, and Galaxy.sf. + +

Note that the Galaxy Include File package supports both British and +American English, eg: galaxy_colour and galaxy_color are interchangeable, +as are galaxy_colouration and galaxy_coloration, etc. + + +


+GALAXY INCLUDE FILE OPTIONS +
+The options in this section apply to Galaxy.inc. + +

+galaxy_seed +


+This is the random number seed used for all random aspects of the Galaxy +Include File package. Changing this number can result in vastly different +galaxy scenes, and any positive or negative integer accepted by POV-Ray can +be used. The default galaxy_seed value is 0. Each time you include +Galaxy.inc, a new galaxy_seed value is chosen at random. To find out the +new value, see debug_options. + +

+galaxy_colour +


+Use this option to change the overall colour of the galaxy scene. The +exact result of changing this option depends on the current colour of +the galaxy scene, eg. if the current galaxy scene is predominantly green, +setting galaxy_colour to < 1.5, 0.1, 1> will increase the amount of red +in the scene, decrease the amount of green, and leave the blue unaltered, +resulting in a purple coloured galaxy. +
The default galaxy_colour value is < 1, 1, 1> (which has no effect). + +

+galaxy_colouration +


+Use this option to increase of decrease the amount of colour in the galaxy +scene. Good values range from 0 (little or no colour) to 1 or larger (very +saturated colour). Setting this option to a low value means that the +galaxy_colour option has more of an effect. +
The default galaxy_colouration value is 0.5 + +

+galaxy_colour_turb +


+Use this option to alter the amount of colour variation between different +elements of the galaxy scene. Setting this option to 0 results in a +monochromatic galaxy scene, while larger values give greater colour +variation. The default galaxy_colour_turb value is 0.2 + +

+galaxy_intensity +


+Use this option to increase or decrease the overall visibility of the +galaxy scene. Good values usually lie somewhere between 0 (completely +transparent) and 5 (very opaque). +
The default galaxy_intensity value is 1 + +

+galaxy_rotate +


+This option is a vector that is used to rotate the galaxy scene as a whole. +It can be useful when you want to create the illusion of movement in an +animation, without having to transform the camera and all the other objects +in a scene. The default galaxy_rotate value is < 0, 0, 0> + +

+galaxy_distance +


+All the objects in a galaxy scene are arranged around a giant sphere, +usually surrounding the camera. You can use this option to set the size of +this sphere. The default value is 10000, which should be sufficient for +most scenes and animations. If the rest of the objects in your scene are +this size or larger, you may need to increase this value. However, values +that are too large may result in disappearing objects, or cause POV-Ray to +crash when rendering the scene. + +

+galaxy_origin +


+As mentioned above, the objects in a galaxy scene are arranged around a +giant sphere. By default this sphere is centred around < 0, 0, 0>, but +you can use this option to change this value. + +

+galaxy_bg +


+Use this option to disable the elements of the galaxy scene created by the +Galaxy Backgrounds File (Galaxy.bg). Setting this option to false (or off) +removes the background stars, background nebulae, and nebula sphere from +the galaxy scene. To remove these elements individually, see Background File Options. + +

+galaxy_objects +


+Use this option to disable the elements of the galaxy scene created by the +Galaxy Objects File (Galaxy.obj). Setting this option to false (or off) +removes any feature nebulae, stars, comets, star clusters, or meteor +showers from the galaxy scene. Note that this option is always set to +false after including Galaxy.inc; if you wish to include Galaxy.inc a +second time (or third, fourth, etc.) and have it automatically create galaxy +objects, you must manually set galaxy_objects to true before including +Galaxy.inc. + +

+galaxy_starfield +


+Use this option to remove the starfield objects in a galaxy scene created by +the Galaxy Starfield File (Galaxy.sf). Note that this option is always +set to false after including Galaxy.inc; if you wish Galaxy.inc to +automatically create another starfield, you must manually set +galaxy_starfield to true before including Galaxy.inc. + +

+options_only +


+Setting this option to true will cause Galaxy.inc to declare all the options +it uses for Galaxy.bg, Galaxy.obj, and Galaxy.sf, but these three files will +not be automatically included. You can use this to then alter selected +galaxy options, before including some or all of the remaining Galaxy.* files, +eg. say you have discovered you like the galaxy produced by using 7362512 +as the galaxy_seed value, but you want to change the galaxy object used: + +

#declare galaxy_seed = 7362512; +
#declare options_only = true; +
#include "GALAXY.INC" + +
#declare galaxy_object = "Galaxy2" +
#include "GALAXY.OBJ" +
#include "GALAXY.BG" +
#include "GALAXY.SF"
+ +

Note that setting options_only to true is the same as setting galaxy_bg, +galaxy_objects, and galaxy_starfield to false. + +

+debug_options +


+Setting this option to true will cause Galaxy.inc to output all the random +option values it uses to POV-Ray's debug stream. You can then use the +GD +command-line switch, or the Debug_File INI file setting, to direct the +debug stream to a file. This file can then be altered as desired, and +included directly into your scene before including Galaxy.bg, Galaxy.obj, +and/or Galaxy.sf (see the Rand.pov and Rand.ini files for an example of how +this option can be used). + + +


+GALAXY BACKGROUNDS FILE OPTIONS +
+The options in this section apply to Galaxy.bg. In addition to the +options below, the Galaxy Backgrounds File supports the galaxy_intensity, +galaxy_rotate, galaxy_distance, and galaxy_origin options, as detailed above. + +

+galaxy_bgstars +


+This option specifies the type of background star pigment mapped to the +sky_sphere. Values range from 1 (sparse) to 3 (dense), and 4 (sparse) to +6 (dense). The first group has a mixture of faint and light stars, while +the second is mostly composed of bright stars of different colours. If you +don't want any background stars (for an animation, say), set this option +to false. The default galaxy_bgstars value is 2 + +

+galaxy_bgnebula +


+This option specifies the type of nebula pigment mapped to the sky_sphere. +Possible values are: + +
    1 - Default nebula +
    2 - Light reflection nebula +
    3 - Nebula criss-crossed by dark gas lanes +
    4 - Spidery nebula +
    5 - Dense reflection nebula +
    6 - Milky Way pattern +
+ +

Values 1 to 5 correspond roughly with the nebulae created by Galaxy.obj +(see galaxy_object_name). If you don't want a background nebula, set this option +to false. The default galaxy_bgnebula value is 6 + +

+galaxy_nebula_sphere +


+Use this option to create a large sphere (the radius is specified by the +galaxy_distance option) mapped with a nebula pigment. Possible values are +1 to 5, corresponding to the galaxy_bgnebula option. If you don't want a +nebula sphere, set this value to false. +
The default galaxy_nebula_sphere value is 1 + +

+galaxy_nebula_ambient +


+Use this option to change the ambient light value of the nebula sphere. +The default galaxy_nebula_ambient value is < 1, 1, 1> + +

+galaxy_colour1, galaxy_colour2, galaxy_colour3 +


+Use this option to set the RGB colour value used to create the galaxy +background pigments. For a monochromatic galaxy scene, only declare +the first option; for a scene that uses two colours declare both +galaxy_colour1 and galaxy_colour2. Finally, to add another colour to +the galaxy pigments declare all three galaxy_colour options. +
The default galaxy_colour1 value is < 1, 1, 1> (White). + +

+galaxy_star_colouration +


+This option sets the colour saturation used by the six background star +pigments, and by the Milky Way pigment. Good values range from 0 (no +colour) to 1 (complete colour). An interesting effect can be achieved by +using negative numbers, which result in the stars being the opposite colour +to the nebulae and other objects in the galaxy scene. +
The default galaxy_star_colouration value is 0.2 + +

+galaxy_pattern_scale +


+Use this option to alter the size of the patterns used to create the +galaxy background pigments. Changing this option does not alter the general +shape of the pigments; it only changes the scaling of the patterns used +within each pigment. The default galaxy_pattern_scale value is 1 + +

+galaxy_pattern_origin +


+Use this option to translate the origin of the patterns used to create the +galaxy background pigments. Changing this option can completely alter the +shapes created by the pigments, and can be changed gradually within an +animation to create dynamic nebulae, etc. +
The default galaxy_pattern_origin is < 0, 0, 0> + +

+galaxy_turb_origin +


+Many of the galaxy pigments use some sort of turbulence; changing this +option translates the origin of the turbulence before it is applied to the +pigment. You can use this option to alter the shapes of various pigments, +or to animate the turbulence applied to the pigments. +
The default galaxy_turb_origin is < 0, 0, 0> + +

+galaxy_declare_only +


+Setting this option to true stops Galaxy.bg from actually creating the +sky_sphere or nebula sphere to which the galaxy background pigments are +mapped. Instead, the file declares each of the 12 pigments separately, so +that you can then use them in the ways you use any other pigment. The +pigment names are BGStars? (from 1 to 6), BGNebula? (from 1 to 5), and +BGMilkyWay. Each of the pigments is designed to be used at unit size, but +they can be scaled or transformed any way you want, eg: + +

#declare galaxy_declare_only = true; +
#include "GALAXY.BG" + +

sky_sphere { +
pigment {BGStars3} +
pigment {BGMilkyWay rotate z * 45} +
pigment {BGNebula5 scale 2} +
pigment {BGNebula1 rotate < 60, 50, 0>}} + +

box {< -1, -1, -1>, < 1, 1, 1> +
pigment {BGStars6} finish {phong .5}}
+ +

Note that setting galaxy_declare_only to true is the same as setting +galaxy_bgstars, galaxy_bgnebula, and galaxy_nebula_sphere to false. + + +


+GALAXY STARFIELD FILE OPTIONS +
+The options in this section apply to Galaxy.sf. In addition to the +options below, the Galaxy Starfield File supports the galaxy_seed, +galaxy_rotate, and galaxy_origin options, as detailed above. + +

+star_count +


+This option sets the number of star objects created. The larger the number, +the longer the parsing time and memory required. +The default star_count value is 1000 + +

+star_colour +


+This option sets the RGB colour value of the stars. +The default star_colour value is < 0.9, 0.9, 0.9> + +

+star_type +


+This option selects the pigment used on each star object. Possible +values are: + +
    1 - Plain circular star (default) +
    2 - Circular star with halo +
    3 - Circular star with six evenly spaced rays +
+ +

+star_scale +


+Use this option to increase or decrease the size of the star objects. By +default the stars are designed to look best when rendered at resolutions +between 320x240 and 640x480; you may wish use smaller numbers for larger +resolutions, and vice-versa. +The default star_scale value is 1 + +

+star_distance +


+The star objects are arranged around a large sphere; this option sets the +radius of this sphere. The default value is 20000, which should be +sufficient for most scenes and animations. If the rest of the objects in +your scene are this size or larger, you may need to increase this value. +However, values that are too large may result in disappearing objects, or +cause POV-Ray to crash when rendering the scene. + +

+star_spread +


+This option sets the difference between the distances to the closest +(largest) star and the farthest (smallest) star. The option is expressed +as a percentage of the star_distance, eg: the default value of 1 means that +the stars lie somewhere between 20000 and 40000 units away (40000 being +equal to 20000 plus 20000 times 1). Setting this option to 0 would result +in all the star objects being the same distance from the origin. + +

+star_distribution +


+This option sets the ratio of large (close) stars to small (far) stars. +The default value of 1 results in equal numbers of each. Values larger +than 1 give more large stars, while values smaller than 1 give more small +stars. + +

+star_colour_turb +


+Use this option to alter the amount of colour variation between different +stars. Setting this option to 0 results in stars all of the same colour, +while larger values give greater colour variation. +The default star_colour_turb value is 0.2 + +

+star_brightness_turb +


+Use this option to set the amount of brightness variation between different +stars. Setting this option to 0 results in stars all of the same brightness, +while larger values give greater brightness variation. +The default star_brightness_turb value is 0.5 + + +


+GALAXY OBJECTS FILE OPTIONS +
+The options in this section apply to Galaxy.obj. In addition to the +options below, the Galaxy Objects File supports the following options +detailed above: + + + + +

+galaxy_object_name +


+Use this option to select which galaxy object you wish to use. Possible +values are (the case of the strings is not important): + +
    Star1, Star2, Star3, Star4 +
    Nebula1, Nebula2, Nebula3, Nebula4, Nebula5, Nebula6 +
    Galaxy1, Galaxy2, Galaxy3, Galaxy4, Galaxy5 +
    Comet1, Comet2, Comet3 +
    Meteor1, Meteor2 +
+ +

As a shortcut you can just use the first and last letters of the object +name, eg. S3 for Star3, or N4 for Nebula4. If you don't want to create +a galaxy object, set this value to an empty string. +The default galaxy_object_name is Nebula1 + +

+galaxy_object_scale +


+Use this option to increase of decrease the size of the galaxy object. +The default galaxy_object_scale value is 1 + +

+galaxy_object_rotate +


+Use this option to rotate the galaxy object. The object is rotated around +the viewing axis, so only one float value is required. +The default galaxy_object_rotate value is 0 + +

+galaxy_object_flatten +


+Use this option to flatten Galaxy, Comet, and Meteor objects. Good values +lie somewhere between 0 (no flattening) and 1 (completely flattened). You +can also use negative numbers to widen the object instead of thinning it. +The default galaxy_object_flatten value is 0.2 + +

+galaxy_object_position +


+Use this option to move the galaxy object and cluster objects. The +x-component of this option specifies the altitude of the objects, while the +y-component specifies the azimuth of the objects. The z-component is +ignored. The default value of < 0, 0, 0> positions the objects directly +perpendicular to the z-axis. North lies along the z-axis and up lies along +the y-axis. Therefore, < 90, 0, 0> positions the object directly above the +origin, and <-90, 0, 0> positions the objects below the origin. < 0, 90, 0> +positions the objects to the east (along the x-axis), < 0, -90, 0> positions +the objects to the west (along the negative x-axis), and < 0, 180, 0> +positions the objects to the south (along the negative z-axis). You can +combine these two movements using the galaxy_object_position value to place +the galaxy object and cluster objects anywhere in the sky. + +

+galaxy_cluster_name +


+In addition to a single galaxy object you can create a cluster of randomly +positioned, sized, and coloured objects. Use this option to select which +object you wish to use for the cluster, using the same selection as +the galaxy_object_name option. If you don't want to create +a cluster of objects, set this option to an empty string. +The default galaxy_cluster_name is Star1 + +

+galaxy_cluster_objects +


+Use this option to set the number of objects you want to create in the +cluster. The default galaxy_cluster_objects value is 6 + +

+galaxy_cluster_scale +


+Use this option to increase of decrease the size of the individual objects +in the cluster (not the overall size of the cluster itself). The default +galaxy_cluster_scale value is half of the galaxy_object_scale value. + +

+galaxy_cluster_rotate +


+Use this option to rotate each individual object in the cluster (not the +cluster as a whole). The default galaxy_cluster_rotate value is the same +as the galaxy_object_rotate value. + +

+galaxy_cluster_spread +


+Use this option to increase the amount of space between the individual +cluster objects. The option is expressed as an angle, where 0 results in +all the objects being clustered at the same position, while 360 spreads the +objects across the entire sky. +The default galaxy_cluster_spread value is 15 degrees. + +

+galaxy_scale_turb +


+Use this option to alter the amount of size variation between individual +cluster objects. Setting this option to 0 results in all the cluster +objects being the same size, while larger values give greater size +variation. The default galaxy_scale_turb value is 0.5 + +

+galaxy_rotate_turb +


+Use this option to alter the amount of variation (in degrees) between the +rotations of individual cluster objects. Setting this option to 0 results +in all the cluster objects being rotated by the same amount, while setting +this option to 360 gives objects rotated by completely random angles. +The default galaxy_rotate_turb value is 0 + +

+galaxy_declare_only +


+Setting this option to true stops Galaxy.obj from actually creating the +galaxy object and cluster objects. Instead, these objects are declared +(as galaxy_object and galaxy_cluster_object respectively) as textured +discs which can be used like any other object. The discs are scaled +and rotated according to the relevant options above, and are centred +at the origin perpendicular to the z-axis. + + +

+
+
+TROUBLESHOOTING +
+This section contains some common problems you might encounter while using +the Galaxy Include File package, and instructions on how to fix these +problems. + +


+Q) POV-Ray crashes when I try to render my galaxy scene? +
A: This may be caused by objects being larger than POV-Ray's allowed limit. + To make the objects smaller, try decreasing the galaxy_distance value + (the default is 10000), and also the star_distance value if you have + declared this separately. If reducing this value doesn't help, try + reducing the max_trace_level of your scene; the Galaxy Include File + automatically increases the value for each object it creates, so add + the line: + +

global_settings {max_trace_level 10} + +

after including any of the Galaxy.* files. + +


+Q) POV-Ray crashes before even starting to render my galaxy scene? +
A: This is probably caused by a lack of memory; try decreasing your + star_count value, or your galaxy_cluster_objects value if they + are quite large. Otherwise, check the error message POV-Ray gives + you; you have probably tried to redeclare an option that has + already been used by one of the Galaxy Include Files; ensuring that + options are always declared as the same type (eg. vectors are always + redeclared as vectors, etc.) should remove the problem. + +


+Q) POV-Ray renders my galaxy scene, but it is very slow? +
A: This is probably caused by very large objects; try reducing the + galaxy_distance and/or star_distance options as detailed in the first + question. Note, however, that when using many complex pigments like + those used by the Galaxy Include Files a certain amount of calculation + time is to be expected. + +


+Q) I have created an animation using the Galaxy Include File, but the + stars seems to flicker annoyingly? +
A: This is caused by using background stars (mapped to the sky_sphere) + which are only suitable for still scenes. Try setting the + galaxy_sky_sphere option to false before including the Galaxy.* files + to remove the problem. + +


+Q) I am using the galaxy_pattern_origin and/or galaxy_turb_origin options, + and there are some strange artefacts in my galaxy scene? +
A: This is caused by problems with POV-Ray's internal pigment mapping + functions; you should be able to fix the problem by using smaller values + for the galaxy_pattern_origin and galaxy_turb_origin options. + +


+Q) I have tried declaring some of the options, but nothing changes? +
A: Make sure that you have declared all the desired options before + including any of the Galaxy.* files. The files are not designed + to be included once at the beginning of a scene. + +


+Q) How can I use the Galaxy Include File with Moray (or another modeller)? +
A: First export your scene from your modeller to a POV file. Then just add + your desired galaxy options to this file, and include the desired + Galaxy.* files before rendering the scene. If your modeller uses a + right handed coordinate system (like Moray) declare these two options + before any others to ensure that the galaxy objects are positioned + properly: + +

#declare galaxy_distance = < -1, 1, 1> * 10000; +
#declare galaxy_rotate = < -90, 180, 0> ;
+ +


+Q) I want to fly around a galaxy I have created, but this doesn't seem possible? +
A: This is because the galaxy objects are designed to generally be viewed in the background, and so they are placed at a great distance from the other objects in a scene. +You can, however, use any of the galaxy objects just as you would any other object in POV-Ray, so that it can translated, rotated, scaled, etc. +Just use the galaxy_declare_only option to create the galaxy_object, eg: + +

#declare galaxy_colour1 = < 1.3, 1.2, .9> ; +
#declare galaxy_colour2 = < .4, .8, 1> ; +
#declare galaxy_cluster_name = "" + +

#declare galaxy_object_name = "Galaxy3" +
#declare galaxy_object_flatten = 0; +
#declare galaxy_declare_only = true; +
#include "Galaxy.obj" +
object {galaxy_object rotate x * 90 scale 10} + +

camera {location < 1, 2, -3> look_at < 0, .5, 0>} + +


+Q) I rendered my galaxy image using anti-aliasing and all the stars disappeared? +
A: This is usually the result of using the Galaxy.bg file to create stars as a pigment on the sky_sphere. +Stars created in this manner will not work well with anti-aliasing, and it is usually a good idea to set the galaxy_bgstars option to false to remove these background stars if you plan to render the image with anti-aliasing turned on. +In their place, you should use the stars created by Galaxy.sf, as these are actual objects with pigments that have already been anti-aliased. +The best settings for a scene usually depend on the rendering size, but for an 800x600 image these settings work quite well: + +

#declare star_count = 5000; +
#declare star_scale = .5; +
#include "Galaxy.sf"
+ +


+Q) I can't get media to work with the Galaxy Include Files? +
A: Due to the way the Galaxy Include Files create the galaxy objects and stars, the results obtained using POV-Ray 3.1's media can be unpredictable. +Part of the problem is caused by the galaxy objects usually being at a great distance from the other objects in a scene, which makes it very difficult for POV-Ray to calculate accurate media interactions. +One solution is to decrease the galaxy_distance option to bring the galaxy objects closer to the camera, although this can make it difficult to place other objects correctly. +A better solution might be to use localised media container objects, rather than atmospheric media, to only place the media in those sections of the scene that it is required for. +This should give you more control over the media interactions in your scene, and possibly increase the rendering speed as well. + + +

+
+
+COPYRIGHT AND LEGAL INFORMATION +
+The Galaxy Include File package, including Galaxy.inc, Galaxy.bg, Galaxy.obj, Galaxy.sf, all documentation, and +associated sample *.POV files are Copyright 1998 by Chris Colefax. Full +permission is granted to the user to modify any or all of the files for +his/her own use. If modified versions are to be distributed the user +should make clear the modifications that have been made by him/herself. + +

The Galaxy Include File package may be bundled with or without other +software on CD-ROM collections, Bulletin Board systems and other file +archives, providing that all associated files, including documentation and +samples, are included. I would also request that persons intending to +distribute the Galaxy Include File package in this manner or otherwise +would first contact me to ensure that +they are in possession of the latest available version. + +

Further, no restrictions of any sort are placed on the usage of the include +files themselves (Galaxy.inc, Galaxy.bg, Galaxy.obj, and Galaxy.sf), and scene files or images created using the include +files remain entirely the property of the user or users who have created +them. I claim no liability or responsibility for damages or loss resulting +from usage of the include files, or any part of the include file package. + + +

+
+
+CONTACTING THE AUTHOR +
+If you wish to contact me with bug reports, bug fixes, criticisms, +comments, suggested improvements, questions, etc. you can reach me by +email at: + +

ccolefax@geocities.com + +

or by regular mail at: + +

    Chris Colefax +
    PO Box 110 +
    Kuranda, Queensland +
    Australia 4872 + +
+
+ +
+POV-RayTM and Persistence of VisionTM are registered trademarks of the POV-Ray TeamTM +
+ + diff --git a/galaxy/Rand.ini b/galaxy/Rand.ini new file mode 100644 index 0000000..d697002 --- /dev/null +++ b/galaxy/Rand.ini @@ -0,0 +1,25 @@ +; GALAXY INCLUDE FILE: RANDOM GALAXY INI FILE +; ******************************************* +; Use this file to easily render many different (and unique) galaxy scenes. +; First, set the Final_Frame option to the number of renderings you want: + +Final_Frame=100 + +; Then render Rand.pov using this INI file, plus any other options +; you want. To get the options for a particular galaxy, take note of +; the frame number and use it to set the following options, eg. if you +; wanted to find out the options for RAND057.TGA, use 57 (and make +; sure to remove the semicolons): + +;Subset_Start_Frame=57 +;Subset_End_Frame=57 + +; Then remove the semicolon from the following line (and change the file +; name if desired): + +;Debug_File=GX_OPTS.INC + +; You can now render Rand.pov using this INI file, and you will get a +; file called GX_OPTS.INC (or whatever name you are using) which you +; can modify and include directly into your scene, before including +; Galaxy.bg, Galaxy.obj, and Galaxy.sf. diff --git a/galaxy/Rand.pov b/galaxy/Rand.pov new file mode 100644 index 0000000..b1a77f1 --- /dev/null +++ b/galaxy/Rand.pov @@ -0,0 +1,8 @@ +// GALAXY INCLUDE FILE: RANDOM GALAXY SCENE FILE +// ********************************************* +// Use this file to easily render many different (and unique) galaxy +// scenes. For more information, see Rand.ini + + #declare galaxy_seed = (clock - .5) * 2e5; + #declare debug_options = true; + #include "GALAXY.INC" diff --git a/galaxy/Readme.txt b/galaxy/Readme.txt new file mode 100644 index 0000000..4860c61 --- /dev/null +++ b/galaxy/Readme.txt @@ -0,0 +1,25 @@ +************************************************* +GALAXY INCLUDE FILE FOR PERSISTENCE OF VISION 3.x +************************************************* + +Included files: + + Galaxy.inc - Galaxy include file for POV-Ray 3.x + Galaxy.bg - Galaxy backgrounds file for POV-Ray 3.x + Galaxy.obj - Galaxy objects file for POV-Ray 3.x + Galaxy.sf - Galaxy starfield file for POV-Ray 3.x + Galaxy.htm - Instructions for Galaxy.* + Readme.txt - This file + + AllObjs.pov - Samples of all galaxy objects + Trifid.pov - Example of custom galaxy scene + Rand.pov - Samples of random galaxy scenes + Rand.ini - INI file for use with Rand.pov + DnmcOpts.pov - Dynamic galaxy options animation + +See Galaxy.htm for full instructions regarding installation, usage, +troubleshooting, copyright, legal and contact information, etc. + +All the included *.pov files use Galaxy.inc and/or Galaxy.bg, Galaxy.obj, +and Galaxy.sf. Before rendering any of these files, follow the +instructions in Galaxy.htm to properly install the include files. diff --git a/galaxy/Trifid.pov b/galaxy/Trifid.pov new file mode 100644 index 0000000..3a3b669 --- /dev/null +++ b/galaxy/Trifid.pov @@ -0,0 +1,45 @@ +// GALAXY INCLUDE FILE: CUSTOM GALAXY SCENE +// **************************************** +// This scene shows how Galaxy.obj and Galaxy.sf can be used to build +// custom galaxy scenes, piece by piece. +// +// Recommended resolution: 640 x 480, anti-aliasing on + +// STARFIELD + #declare star_count = 2000; + #declare star_scale = .5; + #include "GALAXY.SF" + + #declare galaxy_seed = 1; + #declare star_count = 500; + #declare star_type = 3; + #declare star_colour = <1, .9, .7>; + #declare star_scale = 1.5; + #include "GALAXY.SF" + +// PINK NEBULA + #declare galaxy_colour1 = <1.2, 1, 1.1>; + #declare galaxy_colour2 = <1, .3, .6>; + #declare galaxy_pattern_origin = x * 1; + #declare galaxy_turb_origin = x * -4; + #declare galaxy_object_name = "Nebula3" + #declare galaxy_object_scale = 1.75; + #declare galaxy_object_position = <-5, 5, 0>; + #declare galaxy_cluster_name = "" + #include "GALAXY.OBJ" + +// BLUE NEBULA + #declare galaxy_colour1 = <.5, .9, 1.2>; + #declare galaxy_colour2 = <.1, .3, .5>; + #declare galaxy_pattern_origin = x * -20; + #declare galaxy_object_name = "Nebula2" + #declare galaxy_object_scale = 1.2; + #declare galaxy_object_position = <10, -12, 0>; + #include "GALAXY.OBJ" + +// LARGE STAR + #declare galaxy_object_name = "Star1" + #declare galaxy_colour1 = <1.5, 1.5, 1.5>; + #declare galaxy_object_scale = 1; + #declare galaxy_object_position = <17, -10, 0>; + #include "GALAXY.OBJ"