|
![](/i/fill.gif) |
"Sven Littkowski" <nomail@nomail> wrote:
> I put back to my original code, removing (for now) the DECLARE version you
> suggested. This way, you can see the original file.
>
Hi Sven,
you used the macros within the trace-commands. trace() needs an object
identifier. Below is the code I got running. I had to change the colors a bit.
Best regards,
Michael
/**********************************************************/
#version 3.6;
#include "colors.inc"
#include "rand.inc"
#declare MyRadiosity = no; // yes
global_settings
{
assumed_gamma 1.0
#if(MyRadiosity)
radiosity
{
pretrace_start 0.08
pretrace_end 0.015
count 400
error_bound 0.75
recursion_limit 1
}
#end
}
//#include "SL - Space - Ship - Cargo - Type 001 - Sepaei.inc"
camera
{
location < -10000.0, 10000, -10000.0 >
look_at < 0.0, 0.0, 0.0 >
}
light_source { < -50000, 50000, -50000 > White * 1.0 }
/*
sky_sphere
{
pigment
{
planar
color_map
{
[ 0.0 color < 0.0, 0.0, 0.0 > ]
[ 1.0 color < 0.0, 0.0, 0.0 > ]
}
}
}
*/
// Full Hull
#declare Pseudo_Hull = blob
{
threshold 0.04
sphere // Upper Hull
{
< 0.0, 0.0, 0.0 > 1135.0, 1.0
scale < 10.0, 1.0, 1.0 >
translate < 0.0, 750.0, 0.0 >
}
sphere // Lower Hull
{
< 0.0, 0.0, 0.0 > 1135.0, 1.0
scale < 10.0, 1.0, 1.0 >
translate < 0.0, -750.0, 0.0 >
}
sphere // Middle Hull
{
< 0.0, 0.0, 0.0 > 1135.0, 2.0
scale < 6.0, 1.75, 1.0 >
}
sphere // Flat Disk-Alike Sphere
{
< 0.0, 0.0, 0.0 > 1500.0, 1.0
scale < 2.0, 0.5, 1.0 >
}
sphere // Smaller Field-Generator-Carrying Ellipsoid
{
< 0.0, 0.0, 0.0 > 1500.0, 1.0
scale < 1.0, 0.15, 1.25 >
}
}
// Full Hull
#macro Full_Hull(Showtexture)
#declare Full_HullObj=blob {
threshold 0.04
sphere // Upper Hull
{
< 0.0, 0.0, 0.0 > 1135.0, 1.0
scale < 10.0, 1.0, 1.0 >
translate < 0.0, 750.0, 0.0 >
}
sphere // Lower Hull
{
< 0.0, 0.0, 0.0 > 1135.0, 1.0
scale < 10.0, 1.0, 1.0 >
translate < 0.0, -750.0, 0.0 >
}
sphere // Middle Hull
{
< 0.0, 0.0, 0.0 > 1135.0, 3.0
scale < 6.0, 1.75, 1.0 >
}
sphere // Flat Disk-Alike Sphere
{
< 0.0, 0.0, 0.0 > 1500.0, 1.0
scale < 2.0, 0.5, 1.0 >
}
sphere // Smaller Field-Generator-Carrying Ellipsoid
{
< 0.0, 0.0, 0.0 > 1500.0, 1.0
scale < 1.0, 0.15, 1.25 >
}
#declare Random_1 = seed(2); // Plus_X
#declare Random_2 = seed(7); // Sphere Diameter
#declare Random_3 = seed(3); // Sphere Height
#declare Random_4 = seed(9); // Sphere Translate
#declare Line_X = -6100.0;
#while (Line_X < -800.0)
#declare Trace_Start = < Line_X, 0.0, -2000.0 >;
#declare Trace_Direction = < Line_X, 0.0, 0.0 >;
#declare Trace_Norm = < 0.0, 0.0, 0.0 >;
#declare Sphere_Diameter = RRand(75, 150, Random_2);
#declare Sphere_Y = RRand(0.25, 0.50, Random_3);
#declare Translate_X = Line_X-1500;
#declare Translate_Y = RRand(0, 250, Random_4);
#declare Translate_Z = trace (Pseudo_Hull,
Trace_Start,(Trace_Direction-Trace_Start), Trace_Norm).z+250;
#declare DarkPower = 0.1;
sphere // Middle Constructions (-X +Y -Z)
{
< 0.0, 0.0, 0.0 > Sphere_Diameter, DarkPower
scale < 1.0, Sphere_Y, 1.25 >
pigment { color Green } // texture { Middle_Constructions }
translate < Translate_X, Translate_Y, Translate_Z >
}
sphere // Middle Constructions (-X +Y +Z)
{
< 0.0, 0.0, 0.0 > Sphere_Diameter, DarkPower
scale < 1.0, Sphere_Y, 1.25 >
pigment { color Green } // texture { Middle_Constructions }
translate < Translate_X, Translate_Y, (-1*Translate_Z) >
}
sphere // Middle Constructions (+X +Y -Z)
{
< 0.0, 0.0, 0.0 > Sphere_Diameter, DarkPower
scale < 1.0, Sphere_Y, 1.25 >
pigment { color Green } // texture { Middle_Constructions }
translate < (-1 *Translate_X), Translate_Y, Translate_Z >
}
sphere // Middle Constructions (+X +Y -Z)
{
< 0.0, 0.0, 0.0 > Sphere_Diameter, DarkPower
scale < 1.0, Sphere_Y, 1.25 >
pigment { color Green } // texture { Middle_Constructions }
translate <(-1 *Translate_X), Translate_Y, (-1*Translate_Z) >
}
sphere // Middle Constructions (-X -Y -Z)
{
< 0.0, 0.0, 0.0 > Sphere_Diameter, DarkPower
scale < 1.0, Sphere_Y, 1.25 >
pigment { color Green } // texture { Middle_Constructions }
translate < Translate_X, (-1*Translate_Y), Translate_Z >
}
sphere // Middle Constructions (-X -Y +Z)
{
< 0.0, 0.0, 0.0 > Sphere_Diameter, DarkPower
scale < 1.0, Sphere_Y, 1.25 >
pigment { color Green } // texture { Middle_Constructions }
translate < Translate_X, (-1*Translate_Y), (-1*Translate_Z) >
}
sphere // Middle Constructions (+X -Y -Z)
{
< 0.0, 0.0, 0.0 > Sphere_Diameter, DarkPower
scale < 1.0, Sphere_Y, 1.25 >
pigment { color Green } // texture { Middle_Constructions }
translate < (-1 *Translate_X), (-1*Translate_Y), Translate_Z >
}
sphere // Middle Constructions (+X -Y -Z)
{
< 0.0, 0.0, 0.0 > Sphere_Diameter, DarkPower
scale < 1.0, Sphere_Y, 1.25 >
pigment { color Green } // texture { Middle_Constructions }
translate <(-1 *Translate_X), (-1*Translate_Y), (-1*Translate_Z) >
}
#declare Plus_X = RRand(75, 150, Random_1);
#declare Line_X = Line_X + Plus_X;
#end
#if (Showtexture=yes)
pigment { color Green } // texture { Hull_pigment { color Green } //
texture_Side scale 20000.0 translate < -10000.0, 0.0, 0.0 > }
#end
}
#end
// Full Hull
#macro Cut_Hull(Showtexture)
#declare Cut_HullObj = difference {
Full_Hull(Showtexture)
object { Full_HullObj }
union
{
cylinder
{
< -20000.1, 0.0, 0.0 > < -7500.0, 0.0, 0.0 > 2000.0
}
cylinder
{
< 7500.0, 0.0, 0.0 > < 20000.1, 0.0, 0.0 > 2000.0
}
pigment { color Green } // texture { Hull_pigment { color Green } //
texture_Top scale 20000.0 translate < -10000.0, 0.0, 0.0 > }
}
#declare Trace_Start = < -1000.0, 50.00001, -3000.0 >;
#declare Trace_Direction = < -1000.0, 50.00001, 0.0 >;
#declare Trace_Norm = < 0.0, 0.0, 0.0 >;
#declare Maximum = trace (Full_HullObj,
Trace_Start,Trace_Direction-Trace_Start, Trace_Norm).y - 750.0;
cylinder
{
< 0.0, -50.0, Maximum > < 0.0, 50.0, Maximum > 999.99999
pigment { color Green } // texture { Inside scale 1.0 translate < 0.0,
0.0, 0.0 > }
}
cylinder
{
< 0.0, -50.0, (-1 * Maximum) > < 0.0, 50.0, (-1 * Maximum) > 999.99999
pigment { color Green } // texture { Inside scale 1.0 translate < 0.0,
0.0, 0.0 > }
}
cylinder
{
< 0.0, -49.99999, Maximum > < 0.0, 50.0, Maximum > 1000.0
pigment { color Green } // texture { Hull_pigment { color Green } //
texture_Center_Side scale 20000.0 rotate < 90.0, 0.0, 0.0 > }
}
cylinder
{
< 0.0, -49.99999, (-1 * Maximum) > < 0.0, 50.0, (-1 * Maximum) > 1000.0
pigment { color Green } // texture { Hull_pigment { color Green } //
texture_Center_Side scale 20000.0 rotate < 90.0, 0.0, 0.0 > }
}
}
#end
#declare Up_Low_Hull = difference {
// object { Cut_Hull(no) }
Cut_Hull(no)
object { Cut_HullObj }
box { < -7500.0, -1400.0, -1700.0 > < 7500.0, 1400.0, 1700.0 > }
scale < 1.0, 1.0000000001, 1.0 >
pigment { color Green } // texture { Hull_pigment { color Green } //
texture_Top scale 20000.0 translate < -10000.0, 0.0, 0.0 > }
}
// 4x Hull Ends
#declare Hulls_End = union {
#declare Random_1 = seed(0);
#declare Random_2 = seed(12345);
#declare Count = 0;
#declare Trace_Start = < -7499.99999, 2000.0, 0.0 >;
#declare Trace_Direction = < -7499.99999, 0.0, 0.0 >;
#declare Trace_Norm = < 0.0, 0.0, 0.0 >;
#declare Maximum = trace (Cut_HullObj, Trace_Start,
Trace_Direction-Trace_Start,Trace_Norm).y - 750.0;
#declare Minimum = 100.0;
#declare Maximum_Inner = Maximum-Minimum;
#declare Maximum_Outer = Minimum;
torus { Maximum-Minimum, Minimum rotate < 0.0, 0.0, 90.0 > }
cylinder { < -100.0, 0.0, 0.0 > < 0.0, 0.0, 0.0 > Maximum-Minimum }
// #while (Count < 10)
// #declare Outer=RRand(Minimum, Maximum_Outer, Random_1);
// #declare Inner=RRand(Minimum, Maximum_Inner, Random_1);
// #if (Outer+Inner<=Maximum)
// #declare Count=Count+1;
// #end
// #end
pigment { color Green } // texture { Hull_pigment { color Green } //
texture_End scale 20000.0 translate < -10000.0, 0.0, 0.0 > }
}
// 4x Hangar Light bars
#declare Hangar_Light_Bars = union
{
#declare Thickness = 1.0;
#declare Axis_X = -1000.0;
#while (Axis_X < 1000.0)
#declare Trace_Norm = < 0.0, 0.0, 0.0 >;
#declare Trace1_Start = < Axis_X, 50.00001, -3000.0 >;
#declare Trace1_Direction = < Axis_X, 50.00001, 0.0 >;
#declare Axis_Z1 = trace (Cut_HullObj,
Trace1_Start,Trace1_Direction-Trace1_Start, Trace_Norm).z;
#declare Trace2_Start = < (Axis_X+10.0), 50.00001, -3000.0 >;
#declare Trace2_Direction = < (Axis_X+10.0), 50.00001, 0.0 >;
#declare Axis_Z2 = trace (Cut_HullObj,
Trace2_Start,Trace2_Direction-Trace2_Start, Trace_Norm).z;
sphere { < Axis_X, 50.0, Axis_Z1 > Thickness }
cylinder { < Axis_X, 50.0, Axis_Z1 > < (Axis_X+10.0), 50.0, Axis_Z2 >
Thickness }
sphere { < Axis_X, -50.0, Axis_Z1 > Thickness }
cylinder { < Axis_X, -50.0, Axis_Z1 > < (Axis_X+10.0), -50.0, Axis_Z2 >
Thickness }
sphere { < Axis_X, 50.0, (-1 * Axis_Z1) > Thickness }
cylinder { < Axis_X, 50.0, (-1 * Axis_Z1) > < (Axis_X+10.0), 50.0, (-1 *
Axis_Z2) > Thickness }
sphere { < Axis_X, -50.0, (-1 * Axis_Z1) > Thickness }
cylinder { < Axis_X, -50.0, (-1 * Axis_Z1) > < (Axis_X+10.0), -50.0, (-1 *
Axis_Z2) > Thickness }
#declare Axis_X = Axis_X + 10.0;
#end
#declare Trace2_Start = < (Axis_X+10.0), 50.00001, -3000.0 >;
#declare Trace2_Direction = < (Axis_X+10.0), 50.00001, 0.0 >;
#declare Axis_Z2 = trace (Cut_HullObj,
Trace2_Start,Trace2_Direction-Trace2_Start, Trace_Norm).z;
sphere { < (Axis_X+10.0), 50.0, Axis_Z2 > Thickness }
sphere { < (Axis_X+10.0), -50.0, Axis_Z2 > Thickness }
sphere { < (Axis_X+10.0), 50.0, (-1 * Axis_Z2) > Thickness }
sphere { < (Axis_X+10.0), -50.0, (-1 * Axis_Z2) > Thickness }
pigment { color Green } // texture { Hangar_Light_Stripe }
}
#declare Ship = union
{
// object
// {
Cut_Hull(yes)
// }
object
{
Up_Low_Hull
}
object
{
Hulls_End
translate < -7500.0, 750.0, 0.0 >
}
object
{
Hulls_End
translate < 7500.0, 750.0, 0.0 >
}
object
{
Hulls_End
translate < -7500.0, -750.0, 0.0 >
}
object
{
Hulls_End
translate < 7500.0, -750.0, 0.0 >
}
object
{
Hangar_Light_Bars
}
}
union
{
object
{
Ship
}
}
Post a reply to this message
|
![](/i/fill.gif) |