Created
August 1, 2023 12:13
-
-
Save stla/46ae563ebe53123cc8cb36590f82bded to your computer and use it in GitHub Desktop.
Rotoide with POV-Ray
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 3.8; | |
global_settings { assumed_gamma 1 } | |
#include "colors.inc" | |
#include "textures.inc" | |
/* camera */ | |
camera { | |
location <-11, 7,-32> | |
look_at 0 | |
angle 45 | |
} | |
// sun ------------------------------------------------------------------------- | |
light_source {< 4000,6000,-6000> color rgb<1,1,1>*0.9} // sun | |
light_source {<-11, 7,-32> color rgb<0.9,0.9,1>*0.1 shadowless} // flash | |
// sky ------------------------------------------------------------------------- | |
plane{<0,1,0>,1 hollow | |
texture{ pigment{ bozo turbulence 1.3 | |
color_map { [0.00 rgb <0.24, 0.32, 1.0>*0.6] | |
[0.75 rgb <0.24, 0.32, 1.0>*0.6] | |
[0.83 rgb <1,1,1>] | |
[0.95 rgb <0.25,0.25,0.25>] | |
[1.0 rgb <0.5,0.5,0.5>]} | |
scale<1,1,1>*2.5 translate< 0,0,3> | |
} | |
finish {ambient 1 diffuse 0} } | |
scale 10000} | |
// fog on the ground ----------------------------------------------------------- | |
fog { fog_type 2 | |
distance 50 | |
color Gray10 | |
fog_offset 0.1 | |
fog_alt 1.5 | |
turbulence 1.8 | |
} | |
// ground ---------------------------------------------------------------------- | |
plane { <0,1,0>, 0 | |
texture { | |
pigment { color rgb <0.95,0.9,0.73>*0.35 } | |
normal { bumps 2 scale <0.25,0.25,0.25>*0.5 turbulence 0.5 } | |
finish { phong 0.1 } | |
} | |
} | |
/* rotoide function */ | |
#macro Func(theta, s) | |
#local fs = s + 7*sin(s/12 + theta) - 7*theta; | |
< | |
(7 + 2*cos(fs)) * cos(s/12), | |
(7 + 2*cos(fs)) * sin(s/12), | |
2 * sin(fs) | |
> | |
#end | |
/* macro to draw the rotoide */ | |
#macro Rotoide(theta, Tex) | |
sphere_sweep { | |
b_spline 1001 | |
#for(k, 0, 1000) | |
#local M = Func(theta, 24*pi*k/1000); | |
M 0.3 | |
#end | |
texture { | |
Tex | |
} | |
} | |
#end | |
/*-----------------------------------------*/ | |
/*----- draw the rotoide ------*/ | |
/*-----------------------------------------*/ | |
#declare theta = 2*frame_number*pi/180; | |
#declare Texture1 = texture { | |
pigment { color Red } | |
finish { | |
ambient .1 | |
diffuse .9 | |
reflection 0 | |
specular 1 | |
metallic | |
} | |
}; | |
#declare Texture2 = texture { | |
pigment { color Yellow } | |
finish { | |
ambient .1 | |
diffuse .9 | |
reflection 0 | |
specular 1 | |
metallic | |
} | |
}; | |
object { | |
union { | |
Rotoide(theta, Texture1) | |
torus { | |
7, 0.7 | |
texture { Texture2 } | |
rotate <90, 0, 0> | |
} | |
} | |
translate <-10, 10, -40> | |
scale 0.45 | |
} |
Author
stla
commented
Aug 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment