POV-Ray : Newsgroups : povray.text.scene-files : Rolling wheel Server Time
22 Dec 2024 14:46:57 EST (-0500)
  Rolling wheel (Message 1 to 3 of 3)  
From: Christopher James Huff
Subject: Rolling wheel
Date: 22 Nov 2003 11:53:09
Message: <cjameshuff-B4F22C.11475522112003@netplex.aussie.org>
#include "transforms.inc"

global_settings {assumed_gamma 1}

#default {finish {ambient 0 diffuse 1}}

background {rgb 1}

#local CamPos = < 0, 5,-8>*2;
camera {
    location CamPos
    up y*image_height/image_width
    right x
    look_at < 0, 1, 0>
    angle 35
}

light_source {CamPos, color rgb 0.05}
light_source {<-100, 100,-500>, color White}
light_source {<100, 50,-25>, color rgb 0.1}

plane {y, 0
    texture {
        pigment {checker rgb 0, rgb 1}
    }
}

#local Path =
spline {natural_spline
    -0.1, <-0.5, 0, 0>,
    0.0, < 0, 0, 0>,
    0.3, < 2, 0, 0.5>,
    0.5, < 4, 0, 2>,
    0.6, < 5, 0, 6>,
    0.7, < 0, 0, 4>,
    0.75, <-2, 0, 5>,
    0.8, <-4, 0, 5>,
    0.9, <-3, 0, 1>,
    1.0, <-2, 0,-1>,
    1.1, <-2, 0,-1.5>,
}

#macro SplineLength(Spline, IntStart, IntEnd, SubIntervals)
    #local J = 0;
    #local Len = 0;
    #local N = SubIntervals;
    #local IntLen = (IntEnd - IntStart);
    #local Delt = IntLen/N;
    #while(J < SubIntervals)
        #local Len = Len + vlength(Spline(IntLen*J/N + IntStart + Delt) 
- Spline(IntLen*J/N + IntStart));
        #local J = J + 1;
    #end
    (Len)
#end

#macro SplineDirection(Spline, T)
    vnormalize(Spline(T + 0.01) - Spline(T))
#end

#macro Wheel(Spline, Clock, Rad, Obj)
#local Circumference = Rad*2*pi;
    object {Obj
        rotate -z*360*SplineLength(spline {Spline}, 0, Clock, 
500)/Circumference
        Reorient_Trans(x, SplineDirection(spline {Spline}, Clock))
        translate y*Rad + Spline(Clock)
    }
#end


/*union {
    #local J = 0;
    #local N = 20;
    #while(J < N)
        Wheel(spline {Path}, J/N, 1, 
            sphere {< 0, 0, 0>, 1 scale < 1, 1, 0.1>
                texture {
                    pigment {radial rotate -x*90
                        color_map {
                            [0 rgb < 1, 0, 0>]
                            [1/6 rgb < 1, 1, 0>]
                            [2/5 rgb < 0, 1, 0>]
                            [3/6 rgb < 1, 0, 1>]
                            [4/6 rgb < 0, 0, 1>]
                            [5/6 rgb < 0, 1, 1>]
                            [6/6 rgb < 1, 0, 0>]
                        }
                    }
                }
            }
        )
        #local J = J + 1;
    #end
}*/


Wheel(spline {Path}, clock, 1, 
    sphere {< 0, 0, 0>, 1 scale < 1, 1, 0.1>
        texture {
            pigment {radial rotate -x*90
                color_map {
                    [0 rgb < 1, 0, 0>]
                    [1/6 rgb < 1, 1, 0>]
                    [2/5 rgb < 0, 1, 0>]
                    [3/6 rgb < 1, 0, 1>]
                    [4/6 rgb < 0, 0, 1>]
                    [5/6 rgb < 0, 1, 1>]
                    [6/6 rgb < 1, 0, 0>]
                }
            }
        }
    }
)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Elvin Peterson
Subject: Re: Rolling wheel
Date: 12 Mar 2004 00:47:38
Message: <40514efa@news.povray.org>
Christopher James Huff wrote:
> 
> #include "transforms.inc"
> 

#include "colors.inc"


Post a reply to this message

From: majestic99
Subject: Re: Rolling wheel
Date: 31 Oct 2004 15:20:00
Message: <web.41854846bfb527dba1dcceb0@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
> #include "transforms.inc"
>
> This is Awsome!  Thanks!

>
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tagpovrayorg
> http://tag.povray.org/


Post a reply to this message

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