POV-Ray : Newsgroups : povray.text.scene-files : YingYang source (by request) Server Time
1 Nov 2024 03:18:11 EDT (-0400)
  YingYang source (by request) (Message 1 to 1 of 1)  
From: Bruce Duncan
Subject: YingYang source (by request)
Date: 22 Jul 2002 14:01:55
Message: <urhojuskcfdt0ivmdfegsemulm3fjrs1p3@4ax.com>
As requested here is the source I used to render the image posted in
p.b.i.     You may have to fix the line breaks.

Enjoy.


---8<---- cut here

#version 3.5

global_settings {
    assumed_gamma 1.0
}


camera {
    location <-0.5, 2, -1>
    look_at <0, -0.25, 0>
}

/*
camera {    // end view
    location <0, 0, -3>
    look_at <0, 0, 0>
}
*/

light_source {
    <10, 10, 10>
    color rgb 1
}

light_source {
    <-10, 10, -10>
    color rgb 1
}


plane {
    y, -1
    pigment {
        checker rgb 0.8, rgb 0.7
    }
}

plane {
    -y, -100
    pigment { color rgb <0.7,0.7,1> * 0.8 }
}


#declare yy_n = 15;     // (visible) sweep components, higher =
better/slower
#declare yy_i = -1;

#declare ying = union {
    difference {

        sphere_sweep {
            b_spline
            yy_n + 3,

            #while( yy_i <= yy_n + 1 )

                #declare yy_a = radians( (yy_i / yy_n) * 180 );
                #declare yy_x = cos( yy_a ) / ( cos( yy_a ) -3 ) * 2;
                #declare yy_z = sin( yy_a ) / ( cos( yy_a ) -3 ) * 2;
                #declare yy_r = ( cos( yy_a ) - 1 ) / ( cos( yy_a ) -3
);

                <yy_x, 0, yy_z>, yy_r           // place node

                #declare yy_i = yy_i + 1;
            #end

            tolerance 0.1

            scale <1, 0.5, 1>
        }

        sphere { <0.5, 0, 0>, 0.31 }
    }

    sphere { <-0.5, 0, 0>, 0.3 }

    rotate y*90
}

#declare yang = object {
    ying
    rotate y*180
}

union {
    object {
        ying

        texture {
            pigment { color rgb 1 }
            normal { bumps 0.05 scale 0.01 }
            finish { specular 1 roughness 0.001 reflection 0.1
brilliance 5 }
        }
    }

    object {
        yang

        texture {
            pigment { color rgb 0.1 }
            normal { bumps 0.05 scale 0.01 }
            finish { specular 1 roughness 0.001 reflection 0.1
brilliance 5 }
        }
    }
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.