//********************************************************************** // // Bender // // Look out, meatbags, Bender's in town! // //********************************************************************** #include "RickTextures.inc" #include "shapes.inc" #include "transforms.inc" #declare EPSILON = 0.0001; //********************************************************************** // // texture // //********************************************************************** #declare BodyTexture = texture { pigment { color < 0.7, 0.7, 0.9 > } finish { ambient 0.3 diffuse 0.5 phong 0.4 phong_size 20.0 metallic reflection 0.15 brilliance 3 } } #declare LimbTexture = texture { pigment { color < 0.525, 0.525, 0.675 > } finish { ambient 0.3 diffuse 0.5 phong 0.4 phong_size 20.0 metallic reflection 0.15 brilliance 3 } } // Textures for Bender from Universe 1 // // #declare BodyTexture = // texture { // pigment { // color Gold2 // } // finish { // ambient 0.3 // diffuse 0.5 // reflection 0.3 // brilliance 8 // specular 0.5 // } // } // // #declare LimbTexture = // texture { // pigment { // color Gold2 * 0.9 // } // finish { // ambient 0.3 // diffuse 0.5 // reflection 0.3 // brilliance 8 // specular 0.5 // } // } // #declare BodyTexture = // texture { // Rusty_Iron // } // // #declare LimbTexture = // texture { // Rusty_Iron // } #declare AntennaTexture = texture { LimbTexture } #declare EyeTexture = texture { pigment { color < 1.0, 1.0, 0.6 > } finish { ambient 0.7 diffuse 0.2 phong 0.2 phong_size 120.0 metallic } } #declare PupilTexture = texture { pigment { Black } } #declare DarkTexture = texture { pigment { Gray05 } finish { ambient 1.0 diffuse 0.0 } } //********************************************************************** // // Antenna // // centered on bottom of base // //********************************************************************** #declare AntennaBaseY = -0.05; #declare AntennaHeight = 1.0; #declare AntennaBallY = AntennaBaseY + AntennaHeight; #declare Antenna = union { sphere { < 0, AntennaBaseY, 0 >, 0.25 scale < 1, 0.5, 1 > texture { BodyTexture } } cone { < 0, AntennaBaseY, 0 >, 0.10, < 0. AntennaBallY, 0 >, 0.06 texture { AntennaTexture } } sphere { < 0, AntennaBallY, 0 > 0.15 texture { BodyTexture } } } //********************************************************************** // // Visor // //********************************************************************** #declare VisorStraightX = 1.3; #declare VisorStraightY = 0.175; #declare VisorLargeRadius = 0.35; #declare VisorSmallRadius = 0.125; #declare VisorFrontZ = -0.8; #declare VisorBackZ = 0.4; #declare VisorOuterThickness = 0.125; #declare VisorY = 2.0; #declare VisorZ = -1.025; #declare VisorWidth = VisorStraightX + VisorLargeRadius * 2 + VisorSmallRadius * 2; #declare VisorHeight = VisorLargeRadius * 2 + VisorSmallRadius * 2 + VisorStraightY; #declare VisorInnerRadius = VisorLargeRadius + VisorSmallRadius - VisorOuterThickness; #declare Visor1 = object { torus { VisorLargeRadius, VisorSmallRadius } } #declare Visor2 = union { object { Visor1 rotate < -90, 0, 0 > translate < -VisorStraightX / 2, 0, VisorFrontZ + VisorSmallRadius > } object { Visor1 rotate < -90, 0, 0 > translate < VisorStraightX / 2, 0, VisorFrontZ + VisorSmallRadius > } cylinder { < -VisorStraightX / 2, 0, VisorFrontZ >, < -VisorStraightX / 2, 0, VisorBackZ >, VisorLargeRadius } cylinder { < VisorStraightX / 2, 0, VisorFrontZ >, < VisorStraightX / 2, 0, VisorBackZ >, VisorLargeRadius } cylinder { < -VisorStraightX / 2, 0, VisorFrontZ + VisorSmallRadius >, < -VisorStraightX / 2, 0, VisorBackZ - VisorSmallRadius >, VisorLargeRadius + VisorSmallRadius } cylinder { < VisorStraightX / 2, 0, VisorFrontZ + VisorSmallRadius >, < VisorStraightX / 2, 0, VisorBackZ - VisorSmallRadius >, VisorLargeRadius + VisorSmallRadius } object { Visor1 rotate < -90, 0, 0 > translate < -VisorStraightX / 2, 0, VisorBackZ - VisorSmallRadius > } object { Visor1 rotate < -90, 0, 0 > translate < VisorStraightX / 2, 0, VisorBackZ - VisorSmallRadius > } } #declare Visor3 = union { SplitScaleY( Visor2, 1.0, 1.0, 0.0, VisorStraightY ) cylinder { < -VisorStraightX / 2, VisorLargeRadius + VisorStraightY / 2, VisorFrontZ + VisorSmallRadius >, < VisorStraightX / 2, VisorLargeRadius + VisorStraightY / 2, VisorFrontZ + VisorSmallRadius >, VisorSmallRadius } cylinder { < -( VisorStraightX / 2 ), -( VisorHeight / 2 - VisorSmallRadius ), VisorFrontZ + VisorSmallRadius >, < VisorStraightX / 2, -( VisorHeight / 2 - VisorSmallRadius ), VisorFrontZ + VisorSmallRadius >, VisorSmallRadius } box { < -VisorStraightX / 2, -( VisorHeight / 2 ), VisorBackZ - VisorSmallRadius >, < VisorStraightX / 2, VisorHeight / 2, VisorFrontZ + VisorSmallRadius > } box { < -VisorStraightX / 2, -( VisorHeight / 2 - VisorSmallRadius ), VisorBackZ >, < VisorStraightX / 2, ( VisorHeight / 2 - VisorSmallRadius ), VisorFrontZ > } box { < -( VisorWidth / 2 - VisorSmallRadius ), -( VisorStraightY / 2 ), VisorBackZ >, < VisorWidth / 2 - VisorSmallRadius, VisorStraightY / 2, VisorFrontZ > } box { < -( VisorWidth / 2 ), -( VisorStraightY / 2 ), VisorBackZ - VisorSmallRadius >, < VisorWidth / 2, VisorStraightY / 2, VisorFrontZ + VisorSmallRadius > } cylinder { < -( VisorWidth / 2 - VisorSmallRadius ), -( VisorStraightY / 2 ), VisorFrontZ + VisorSmallRadius >, < -( VisorWidth / 2 - VisorSmallRadius ), VisorStraightY / 2, VisorFrontZ + VisorSmallRadius >, VisorSmallRadius } cylinder { < VisorWidth / 2 - VisorSmallRadius, -( VisorStraightY / 2 ), VisorFrontZ + VisorSmallRadius >, < VisorWidth / 2 - VisorSmallRadius, VisorStraightY / 2, VisorFrontZ + VisorSmallRadius >, VisorSmallRadius } cylinder { < -( VisorWidth / 2 - VisorSmallRadius ), -( VisorStraightY / 2 ), VisorBackZ - VisorSmallRadius >, < -( VisorWidth / 2 - VisorSmallRadius ), VisorStraightY / 2, VisorBackZ - VisorSmallRadius >, VisorSmallRadius } cylinder { < VisorWidth / 2 - VisorSmallRadius, -( VisorStraightY / 2 ), VisorBackZ - VisorSmallRadius >, < VisorWidth / 2 - VisorSmallRadius, VisorStraightY / 2, VisorBackZ - VisorSmallRadius >, VisorSmallRadius } } #declare Visor4 = union { cylinder { < -VisorStraightX / 2, -VisorStraightY / 2, VisorFrontZ - EPSILON >, < -VisorStraightX / 2, -VisorStraightY / 2, VisorBackZ >, VisorInnerRadius } cylinder { < VisorStraightX / 2, -VisorStraightY / 2, VisorFrontZ - EPSILON >, < VisorStraightX / 2, -VisorStraightY / 2, VisorBackZ >, VisorInnerRadius } cylinder { < -VisorStraightX / 2, VisorStraightY / 2, VisorFrontZ - EPSILON >, < -VisorStraightX / 2, VisorStraightY / 2, VisorBackZ >, VisorInnerRadius } cylinder { < VisorStraightX / 2, VisorStraightY / 2, VisorFrontZ - EPSILON >, < VisorStraightX / 2, VisorStraightY / 2, VisorBackZ >, VisorInnerRadius } box { < -VisorStraightX / 2, -( VisorHeight / 2 - VisorOuterThickness ), VisorBackZ >, < VisorStraightX / 2, VisorHeight / 2 - VisorOuterThickness, VisorFrontZ - EPSILON > } box { < -( VisorWidth / 2 - VisorOuterThickness ), -VisorStraightY / 2, VisorBackZ >, < ( VisorWidth / 2 - VisorOuterThickness ), VisorStraightY / 2, VisorFrontZ - EPSILON > } } //********************************************************************** // // Eyes // //********************************************************************** #declare EyeDiameter = VisorHeight - ( VisorOuterThickness * 2 ); #declare PupilSize = 0.2; #declare EyeZ = -1.4; #declare EyeXOffset = ( VisorStraightX * 0.375 ); #declare Eye = union { object { sphere { < 0, 0, 0 >, EyeDiameter / 2 } texture { EyeTexture } } intersection { object { box { < -PupilSize / 2, -PupilSize / 2, -EyeDiameter >, < PupilSize / 2, PupilSize / 2, 0 > } no_shadow } object { sphere { < 0, 0, 0 >, ( EyeDiameter / 2 ) + EPSILON } } texture { PupilTexture } no_shadow } } #declare LeftEye = union { object { Eye } object { difference { sphere { < 0, 0, 0 >, EyeDiameter / 2 + EPSILON } plane { y, EyeDiameter / 4 } } rotate < 0, 0, 15 > texture { PupilTexture } } } #declare RightEye = union { object { Eye } object { difference { sphere { < 0, 0, 0 >, EyeDiameter / 2 + EPSILON } plane { y, EyeDiameter / 4 } } rotate < 0, 0, -15 > texture { PupilTexture } } } //********************************************************************** // // Head // // centered on the base of the neck // // The head is merged with the visor because of CSG. We want to // get the cutaway texture on the parts of the head clipped by CSG. // //********************************************************************** #declare HeadBottom = 0.0; #declare HeadCenter = 2.75; #declare HeadRadius = 1.25; #declare HeadHeight = ( HeadCenter - HeadBottom ) + HeadRadius; #declare MouthHeight = 0.7; #declare MouthInsideRadius = 1.15; #declare MouthLineThickness = 0.03; #declare MouthLineYDelta = 0.25; #declare MouthY = 0.7; #declare MouthAngularWidth = 90; #declare MouthLinesAngularDelta = 21; #declare HeadOffset = 11.0; #declare Head1 = union { sphere { < 0, HeadCenter, 0 >, HeadRadius } cylinder { < 0, HeadCenter, 0 >, < 0, HeadBottom, 0 >, HeadRadius } } #declare Head2 = difference { union { object { Visor3 translate < 0, VisorY, VisorZ > } object { Head1 } } object { Visor4 translate < 0, VisorY, VisorZ > } texture { BodyTexture } } #declare VisorInterior = difference { object { Visor4 scale < 0.999, 0.999, 1 > translate < 0, VisorY, VisorZ > } object { Visor4 scale < 0.998, 0.998, 1.001 > translate < 0, VisorY, VisorZ - 0.01 > // slide toward front a bit } texture { DarkTexture } } #declare Head3 = union { object { Head2 } object { VisorInterior } object { RightEye translate < -EyeXOffset, VisorY, EyeZ > } object { LeftEye translate < EyeXOffset, VisorY, EyeZ > } } #declare Mouth = union { object { cylinder { < 0, MouthY, -( HeadRadius + EPSILON ) >, < 0, MouthY, 0 >, MouthHeight / 2 } rotate < 0, MouthAngularWidth / 2, 0 > } object { cylinder { < 0, MouthY, -( HeadRadius + EPSILON ) >, < 0, MouthY, 0 >, MouthHeight / 2 } rotate < 0, -MouthAngularWidth / 2, 0 > } difference { cylinder { < 0, MouthY - MouthHeight / 2, 0 >, < 0, MouthY + MouthHeight / 2, 0 >, HeadRadius + EPSILON } object { plane { x, 0 } rotate < 0, MouthAngularWidth / 2, 0 > } object { plane { -x, 0 } rotate < 0, -MouthAngularWidth / 2, 0 > } } } #declare MouthInside = union { object { cylinder { < 0, MouthY - 0.5, 0 >, < 0, MouthY + 0.5, 0 >, MouthInsideRadius } texture { EyeTexture } } union { cylinder { < 0, ( MouthY - MouthLineYDelta / 2 ) - MouthLineThickness / 2, 0 >, < 0, ( MouthY - MouthLineYDelta / 2 ) + MouthLineThickness / 2, 0 >, MouthInsideRadius + EPSILON } cylinder { < 0, ( MouthY + MouthLineYDelta / 2 ) - MouthLineThickness / 2, 0 >, < 0, ( MouthY + MouthLineYDelta / 2 ) + MouthLineThickness / 2, 0 >, MouthInsideRadius + EPSILON } #declare Theta = -( ceil( ( MouthAngularWidth / 2 ) / MouthLinesAngularDelta ) + 1 ); #declare End = -Theta; #while ( Theta <= End ) object { box { < -( MouthLineThickness / 2 ), MouthY - 0.5, 0 >, < ( MouthLineThickness / 2 ), MouthY + 0.5, -( MouthInsideRadius + EPSILON ) > } rotate < 0, Theta * MouthLinesAngularDelta, 0 > } #declare Theta = Theta + 1; #end texture { PupilTexture } } } #declare Head = union { difference { object { Head3 } object { Mouth } } object { MouthInside } } //********************************************************************** // // Torso measurements // //********************************************************************** #declare TorsoMainTopRadius = 2.5; #declare TorsoMainBottomRadius = 2.0; #declare TorsoMainTopY = 2.0; #declare TorsoMainBottomY = -2.5; // These 2 values were chosen by complete trial and error to make the top curved part of the torso // match up with the conical part #declare TorsoTopYRadius = 4.2; #declare TorsoSphereCenterYOffset = -0.5; #declare DoorHoleTopY = TorsoMainTopY - 0.75; #declare DoorHoleBottomY = TorsoMainBottomY + 0.75; #declare DoorHoleTopWidth = 3.0; #declare DoorHoleBottomWidth = 2.4; #declare DoorHoleDepth = 0.06; #declare DoorGap = 0.045; #declare DoorTopY = DoorHoleTopY - DoorGap; #declare DoorBottomY = DoorHoleBottomY + DoorGap; #declare DoorTopWidth = DoorHoleTopWidth - DoorGap; #declare DoorBottomWidth = DoorHoleBottomWidth - DoorGap; #declare DoorCornerRadius = 0.25; #declare KnobY = ( ( DoorTopY + DoorBottomY ) / 2 ) + 0.15; #declare KnobZ = -( TorsoMainTopRadius + TorsoMainBottomRadius ) / 2; #declare TorsoSphereCenterY = ( TorsoMainTopRadius - TorsoTopYRadius ) + TorsoSphereCenterYOffset; #declare TorsoOffset = HeadOffset - 3.0; //********************************************************************** // // Door // // OK, if I'm gonna pull this off I need some really short names... // //********************************************************************** #declare DoorT = DoorTopY; #declare DoorT2 = DoorTopY - DoorCornerRadius; #declare DoorTL = -DoorTopWidth / 2; #declare DoorTL2 = DoorTL + DoorCornerRadius; #declare DoorTR = DoorTopWidth / 2; #declare DoorTR2 = DoorTR - DoorCornerRadius; #declare DoorBL = -DoorBottomWidth / 2; #declare DoorBL2 = DoorBL + DoorCornerRadius; #declare DoorBR = DoorBottomWidth / 2; #declare DoorBR2 = DoorBR - DoorCornerRadius; #declare DoorB = DoorBottomY; #declare DoorB2 = DoorBottomY + DoorCornerRadius; #declare Door1 = union { object { prism { linear_spline -1, 3, 13, < DoorT, DoorTL2 >, < DoorT, DoorTR2 >, < DoorT2, DoorTR2 >, < DoorT2, DoorTR >, < DoorB2, DoorBR >, < DoorB2, DoorBR2 >, < DoorB, DoorBR2 >, < DoorB, DoorBL2 >, < DoorB2, DoorBL2 >, < DoorB2, DoorBL >, < DoorT2, DoorTL >, < DoorT2, DoorTL2 >, < DoorT, DoorTL2 > } rotate < -90, 0, 90 > } object { cylinder { < DoorTL2 - DoorGap, DoorT2 + DoorGap, -3 >, < DoorTL2 - DoorGap, DoorT2 + DoorGap, 1 >, DoorCornerRadius - DoorGap } } object { cylinder { < DoorTR2 + DoorGap, DoorT2 + DoorGap, -3 >, < DoorTR2 + DoorGap, DoorT2 + DoorGap, 1 >, DoorCornerRadius - DoorGap } } object { cylinder { < DoorBL2 - DoorGap, DoorB2 - DoorGap, -3 >, < DoorBL2 - DoorGap, DoorB2 - DoorGap, 1 >, DoorCornerRadius - DoorGap } } object { cylinder { < DoorBR2 + DoorGap, DoorB2 - DoorGap, -3 >, < DoorBR2 + DoorGap, DoorB2 - DoorGap, 1 >, DoorCornerRadius - DoorGap } } } #declare Door = union { object { intersection { object{ Door1 } object { cone { < 0, TorsoMainBottomY, 0 >, TorsoMainBottomRadius, < 0, TorsoMainTopY, 0 >, TorsoMainTopRadius } } } } object { superellipsoid { < 1, 0.4 > } scale < 0.15, 0.15, 0.15 > rotate < -10, 0, 0 > translate < 0, KnobY, KnobZ > rotate < 0, -28, 0 > } texture { BodyTexture } } //********************************************************************** // // Shoulders // //********************************************************************** #declare ShoulderLargeRadius = 0.6; #declare ShoulderSmallRadius = 0.5; #declare ShoulderY = TorsoMainTopY - ( ShoulderLargeRadius + ShoulderSmallRadius ); #declare ShoulderX = TorsoMainTopRadius - ShoulderSmallRadius; #declare Shoulders = union { object { torus { ShoulderLargeRadius, ShoulderSmallRadius } rotate < 75, 0, 0 > translate < 0, ShoulderY, -ShoulderX > rotate < 0, 90, 0 > } object { torus { ShoulderLargeRadius, ShoulderSmallRadius } rotate < 75, 0, 0 > translate < 0, ShoulderY, -ShoulderX > rotate < 0, -90, 0 > } texture { BodyTexture } } //********************************************************************** // // Torso // //********************************************************************** #declare DoorHoleT = DoorT + DoorGap; #declare DoorHoleT2 = DoorT2 + DoorGap; #declare DoorHoleTL = DoorTL - DoorGap; #declare DoorHoleTL2 = DoorTL2 - DoorGap; #declare DoorHoleTR = DoorTR + DoorGap; #declare DoorHoleTR2 = DoorTR2 + DoorGap; #declare DoorHoleBL = DoorBL - DoorGap; #declare DoorHoleBL2 = DoorBL2 - DoorGap; #declare DoorHoleBR = DoorBR + DoorGap; #declare DoorHoleBR2 = DoorBR2 + DoorGap; #declare DoorHoleB = DoorB - DoorGap; #declare DoorHoleB2 = DoorB2 - DoorGap; #declare DoorHole = union { object { prism { linear_spline -1, 3, 13, < DoorHoleT, DoorHoleTL2 >, < DoorHoleT, DoorHoleTR2 >, < DoorHoleT2, DoorHoleTR2 >, < DoorHoleT2, DoorHoleTR >, < DoorHoleB2, DoorHoleBR >, < DoorHoleB2, DoorHoleBR2 >, < DoorHoleB, DoorHoleBR2 >, < DoorHoleB, DoorHoleBL2 >, < DoorHoleB2, DoorHoleBL2 >, < DoorHoleB2, DoorHoleBL >, < DoorHoleT2, DoorHoleTL >, < DoorHoleT2, DoorHoleTL2 >, < DoorHoleT, DoorHoleTL2 > } rotate < -90, 0, 90 > } object { cylinder { < DoorHoleTL2, DoorHoleT2, -3 >, < DoorHoleTL2, DoorHoleT2, 1 >, DoorCornerRadius } } object { cylinder { < DoorHoleTR2, DoorHoleT2, -3 >, < DoorHoleTR2, DoorHoleT2, 1 >, DoorCornerRadius } } object { cylinder { < DoorHoleBL2, DoorHoleB2, -3 >, < DoorHoleBL2, DoorHoleB2, 1 >, DoorCornerRadius } } object { cylinder { < DoorHoleBR2, DoorHoleB2, -3 >, < DoorHoleBR2, DoorHoleB2, 1 >, DoorCornerRadius } } } #declare Torso1 = union { Round_Cone_Union( < 0, TorsoMainBottomY, 0 >, TorsoMainBottomRadius, < 0, TorsoMainTopY, 0 >, TorsoMainTopRadius, 0.1 ) difference { object { sphere { < 0, TorsoSphereCenterY, 0 >, TorsoTopYRadius } scale < 0.975, 1.7, 0.975 > } plane { y, TorsoMainTopY - 0.03 } } texture { BodyTexture } } #declare Torso = union { difference { object { Torso1 } object { DoorHole } texture { BodyTexture } } object { cone { < 0, TorsoMainBottomY + 0.5, 0 >, TorsoMainBottomRadius - DoorHoleDepth, < 0, TorsoMainTopY - 0.5, 0 >, TorsoMainTopRadius - DoorHoleDepth } texture { DarkTexture } } object { Door } object { Shoulders } } //********************************************************************** // // Hand // //********************************************************************** #declare HandSmallRadius = 0.5; #declare HandLargeRadius = 0.7; #declare HandLength = 0.7; #declare FingerWidth = 0.4; #declare FingerLength = 0.8; #declare PalmRadius = 1.5; #declare PalmOffset = 0.875; // once again, trial and error, maybe my math is just faulty #declare FingerOffset = 0.45; #declare Hand1 = union { Connect_Spheres( < 0, 0, 0 >, HandSmallRadius, < 0, -HandLength * 5, 0 >, HandLargeRadius ) object { sphere { < 0, 0, 0 >, HandLargeRadius } translate < 0, -HandLength * 5, 0 > } scale < 1, 0.2, 1 > } #declare Finger = union { cylinder { < 0, 0, 0 >, < 0, -FingerLength, 0 >, FingerWidth / 2 } object { sphere { < 0, 0, 0 >, FingerWidth / 2 } scale < 1, 0.5, 1 > translate < 0, -FingerLength, 0 > } } #declare Hand = union { object { Hand1 } object { Finger translate < FingerOffset, -HandLength, 0 > } object { Finger translate < FingerOffset, -HandLength, 0 > rotate < 0, 120, 0 > } object { Finger translate < FingerOffset, -HandLength, 0 > rotate < 0, 240, 0 > } texture { BodyTexture } } //********************************************************************** // // Arms // //********************************************************************** #declare ArmDiameter = 0.5; #declare RightArm1 = object { sphere_sweep { b_spline 7 < 0.5, 0.0, 0.0 >, ArmDiameter, // gets the spline going < 0.0, 0.0, 0.0 >, ArmDiameter, < -0.8, -0.1, 0.05 >, ArmDiameter, < -1.3, -1.3, -0.25 >, ArmDiameter, < -1.3, -2.0, -0.4 >, ArmDiameter, < -1.0, -4.0, -0.5 >, ArmDiameter, < -0.7, -5.0, -0.6 >, ArmDiameter // gets the spline going tolerance 0.00001 } translate < -ShoulderX, ShoulderY + TorsoOffset, 0 > texture { LimbTexture } } #declare LeftArm1 = object { sphere_sweep { b_spline 7 < -0.5, 0.0, 0.0 >, ArmDiameter, // gets the spline going < 0.0, 0.0, 0.0 >, ArmDiameter, < 0.8, -0.1, -0.05 >, ArmDiameter, < 1.3, -1.1, -0.4 >, ArmDiameter, < 1.3, -2.6, -1.0 >, ArmDiameter, < 1.0, -3.5, -1.4 >, ArmDiameter, < 0.7, -4.5, -1.7 >, ArmDiameter // gets the spline going tolerance 0.00001 } translate < ShoulderX, ShoulderY + TorsoOffset, 0 > texture { LimbTexture } } #declare RightArm = union { object { RightArm1 } object { Hand rotate < 15, 0, 15 > translate < -ShoulderX, ShoulderY + TorsoOffset, 0 > translate < -1.0, -4.0, -0.5 > } } #declare LeftArm = union { object { LeftArm1 } object { Hand rotate < 15, 0, -15 > translate < ShoulderX, ShoulderY + TorsoOffset, 0 > translate < 1.0, -3.5, -1.4 > } } // #include "bsplines.inc" // // #declare LeftArm_Array = // array[ 8 ] { // < -0.5, 0.0, 0.0, 0 >, // < 0.0, 0.0, 0.0, 0 >, // < 0.8, -0.1, -0.05, 0 >, // < 1.3, -1.1, -0.4, 0 >, // < 1.3, -2.6, -1.0, 0 >, // < 1.15, -3.05, -1.2, 0 >, // < 1.0, -3.5, -1.4, 0 >, // < 0.7, -4.5, -1.7, 0 > // } // // BSpline2Linear( LeftArm_Array, 1000, 5, "LeftArm.spl" ) // // #include "LeftArm.spl" // // #declare i = 0; // #while (i < 5 ) // object { // cylinder { < 0, 0, -0.02 >, < 0, 0, 0.02 >, ArmDiameter + EPSILON + 0.2 } // Point_At_Trans( BSpline_Dir( LeftArm_Array, Linear_Mover( Linear_Node, Linear_Node[ i ].t ) ) ) // // BSpline_Align( Linear_Node, Linear_Node[ i ], 0, 0 ) // translate < Linear_Node[ i ].x, Linear_Node[ i ].y, Linear_Node[ i ].z > // translate < ShoulderX, ShoulderY + TorsoOffset, 0 > // } // #declare i = i + 1; // #end //********************************************************************** // // Foot // //********************************************************************** #declare FootSize = 1.2; #declare Foot = object { difference { sphere { < 0, 0, 0 >, FootSize } plane { y, 0 } } scale < 1, 0.7, 1 > texture { BodyTexture } } //********************************************************************** // // Legs // //********************************************************************** #declare RightLegX = -0.9; #declare LeftLegX = 0.9; #declare LegDiameter = 0.5; #declare RightLeg = object { difference { sphere_sweep { b_spline 8 < 0.03, 7.0, 0.0 >, LegDiameter, // gets the spline going < 0.0, 6.5, 0.0 >, LegDiameter, < -0.05, 5.8, 0.0 >, LegDiameter, < -0.15, 5.0, -0.5 >, LegDiameter, < -0.3, 3.6, -0.7 >, LegDiameter, < -0.45, 2.0, -0.5 >, LegDiameter, < -0.52, 0.0, 0.0 >, LegDiameter, < -0.55, -1.0, 0.3 >, LegDiameter // gets the spline going } plane { y, EPSILON } } translate < RightLegX, 0, 0 > texture { LimbTexture } } #declare LeftLeg = object { difference { sphere_sweep { b_spline 7 < -0.03, 7.0, -0.2 >, LegDiameter, // gets the spline going < 0.0, 6.5, 0.0 >, LegDiameter, < 0.05, 5.8, -0.2 >, LegDiameter, < 0.15, 4.0, -0.75 >, LegDiameter, < 0.25, 2.0, -0.55 >, LegDiameter, < 0.3, 0.0, 0.0 >, LegDiameter, < 0.3, -1.0, 0.0 >, LegDiameter // gets the spline going } plane { y, EPSILON } } translate < LeftLegX, 0, 0 > texture { LimbTexture } } //********************************************************************** // // Foot // //********************************************************************** #declare FootSize = 1.1; #declare Foot = object { difference { sphere { < 0, 0, 0 >, FootSize } plane { y, 0 } } scale < 1, 0.8, 1 > texture { BodyTexture } } //********************************************************************** // // The whole Bender, baby! // //********************************************************************** #declare Bender = union { object { Antenna translate < 0, HeadOffset + HeadHeight, 0 > } object { Head translate < 0, HeadOffset , 0 > } object { Shoulders translate < 0, TorsoOffset, 0 > } object { LeftArm } object { RightArm } object { LeftLeg } object { RightLeg } object { Torso translate < 0, TorsoOffset, 0 > } // object { // cone { < 0, TorsoMainBottomY, 0 >, TorsoMainBottomRadius, // < 0, TorsoMainBottomY - EPSILON, 0 >, TorsoMainBottomRadius } // translate < 0, TorsoOffset, 0 > // } // object { Foot translate < RightLegX - 0.3, 0, 0 > } object { Foot translate < LeftLegX + 0.2, 0, 0 > } }