POV-Ray : Newsgroups : povray.text.scene-files : Deformed isotorii Server Time
31 Oct 2024 12:17:18 EDT (-0400)
  Deformed isotorii (Message 1 to 1 of 1)  
From: Chris Huff
Subject: Deformed isotorii
Date: 8 Jul 2000 14:22:35
Message: <chrishuff-FEC0EA.13225008072000@news.povray.org>
#include "colors.inc"
#version unofficial MegaPov 0.5;

global_settings {
    assumed_gamma 1
    ambient_light 0
}
// ----------------------------------------
#declare CamPos = <0, 5,-12>;
camera {
    up y*image_height right x*image_width
    location CamPos
    angle 45
    look_at < 0, 2, 0>
}

light_source {CamPos color White*0.3}
light_source {< 10, 20, 30> color White*0.5}
light_source {<-20, 30,-30>*3 color White}
// ----------------------------------------

sphere {<0,0,0>,1
    texture {
        pigment {granite
            color_map {
                [0 color rgb < 0.2, 0.25, 0.9>]
                [0.15 color rgb < 0.2, 0.25, 0.9>]
                [1 color White]
            }
            scale < 2, 0.25, 2>
        }
        finish {ambient 1 diffuse 1}
    }
    hollow
    scale 10000
}

box {<-10, 0,-10>, < 10, 0, 10>
    texture {
        pigment {checker color Black color White}
    }
}


#declare Angle = 
function {atan2(x, y)*z}

#declare R0 = 2;//Major radius
#declare R1 = 0.5;//Minor radius
#declare A = 0.2;//Ridge amplitude
#declare NT = 8;//Number of twists
#declare NR = 3;//Number of ridges
#declare twistTorFunc = 
function {
        sqrt(sqr(sqrt(sqr(x)+sqr(z)) - R0)+sqr(y))
        -R1+cos(Angle(x,z,NT)+Angle(sqrt(sqr(x)+sqr(z)) - R0,y,NR))*A
}

isosurface {
    function {
            sqrt(sqr(sqrt(sqr(x)+sqr(z)) - R0)+sqr(y))
            -R1+cos(Angle(x,z,NT)+Angle(sqrt(sqr(x)+sqr(z)) - R0,y,NR))*A
    }
    threshold 0
    eval
    max_gradient 2.25
    contained_by {box {<-4,-1,-3>, < 3, 1, 3>}}
    texture {
        pigment {color rgb < 1, 1, 0.35>}
        finish {
            ambient 0 diffuse 0.3 reflection 0.7
            reflect_metallic
            metallic
            blinn 1
        }
    }
    rotate x*90 translate y*2
    translate <-3, 1, 3>
}

#declare R0 = 2;//Major radius
#declare R1 = 0.5;//Minor radius
#declare A = 0.2;//Ridge amplitude
#declare NT = 12;//Number of twists
#declare NR = 3;//Number of ridges
isosurface {
    function {
            sqrt(sqr(sqrt(sqr(x)+sqr(z)) - R0)+sqr(y))
            -R1+ cos(Angle(x,z,NT)+Angle(sqrt(sqr(x)+sqr(z)) - R0,y,NR))
                *cos(Angle(x,z,NT)+Angle(sqrt(sqr(x)+sqr(z)) - 
R0,y,-NR))*A
    }
    threshold 0
    eval
    max_gradient 2.36
    contained_by {box {<-3,-1,-3>, < 3, 1, 3>}}
    texture {
        pigment {color rgb < 1, 0.2, 0.6>}
        finish {
            ambient 0 diffuse 0.3 reflection 0.7
            reflect_metallic
            metallic
            blinn 1
        }
    }
    rotate x*90 translate y*2
    translate < 4, 1, 3>
}

#declare R0 = 2;//Major radius
#declare R1 = 0.5;//Minor radius
#declare A = 0.2;//Ridge amplitude
#declare NT = 12;//Number of twists
#declare NR = 3;//Number of ridges
isosurface {
    function {
            sqrt(sqr(sqrt(sqr(x)+sqr(z)) - R0)+sqr(y))
            -R1+ (cos(Angle(x,z,NT)+Angle(sqrt(sqr(x)+sqr(z)) - 
R0,y,NR))^2)
                *(cos((Angle(x,z,NT)+Angle(sqrt(sqr(x)+sqr(z)) - 
R0,y,-NR))*2)^2)*A
    }
    threshold 0
    eval
    max_gradient 4.21
    contained_by {box {<-3,-1,-3>, < 3, 1, 3>}}
    texture {
        pigment {color rgb < 0.3, 0.2, 0.6>}
        finish {
            ambient 0 diffuse 0.3 reflection 0.7
            reflect_metallic
            metallic
            blinn 1
        }
    }
    interior {ior 12}
    translate < 0, 1, -0.5>
}


#declare R0 = 2;//Major radius
#declare R1 = 0.1;//Minor radius
#declare A = 0.2;//Ridge amplitude
#declare NT = 15;//Number of turns
isosurface {
    function {
        sqrt(sqr(sqrt(sqr(x)+sqr(z)) - 
R0+sin(Angle(x,z,NT))*A)+sqr(y+cos(Angle(x,z,NT))*A))
        -R1
    }
    threshold 0
    eval
    max_gradient 4.21
    contained_by {box {<-3,-1,-3>, < 3, 1, 3>}}
    texture {
        pigment {color rgb < 0.1, 0.5, 0.6>}
        finish {
            ambient 0 diffuse 0.3 reflection 0.7
            reflect_metallic
            metallic
            blinn 1
        }
    }
    interior {ior 12}
    translate < 0, 2, -0.5>
}


#declare R0 = 2;//Major radius
#declare R1 = 0.5;//Minor radius
#declare A = 0.2;//Ridge amplitude
#declare NT = 12;//Number of twists
#declare NR = 3;//Number of ridges
isosurface {
    function {
            sqrt(sqr(sqrt(sqr(x)+sqr(z)) - R0)+sqr(y))
            -R1- (cos(Angle(x,z,NT)+Angle(sqrt(sqr(x)+sqr(z)) - R0,y, 
NR))^2)
                *(cos(Angle(x,z,NT)+Angle(sqrt(sqr(x)+sqr(z)) - 
R0,y,-NR))^2)*A
    }
    threshold 0
    eval
    max_gradient 4.21
    contained_by {box {<-3,-1,-3>, < 3, 1, 3>}}
    texture {
        pigment {color rgb < 0.3, 0.6, 0.2>}
        finish {
            ambient 0 diffuse 0.3 reflection 0.7
            reflect_metallic
            metallic
            blinn 1
        }
    }
    interior {ior 12}
    translate < 0, 3.5, -0.5>
}

// ----------------------------------------

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

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