|
|
It is said somewhere that every beginner must do a reflecting sphere on a
checker.
So, I'm a beginner, and...
I wanted to be more creative than only copying a single scee everybody
already did, I hope you'll like the result.
And the presentations : I'm 29 years old, french, chemist (R&D engineer),
musician and chess player (a little). I'm beginning in POV-Ray and hope to
be the next Michel Ange (!)
People that can read french could see my progression on
croquis.over-blog.com
The others can still look at the pictures and give me loooots of advices.
See ya later for more interesting pictures !
Ah ! I forgot : the source...
global_settings{
max_trace_level 10
}
#declare R1=seed(0);
camera {
location <-1,6,-8>
look_at <0,2,0>
}
light_source {
<0,5,-15>
color rgb <1,0,0>
}
light_source {
<-0.1,5,-15>
color rgb <0,1,0>
}
light_source {
<0.1,5,-15>
color rgb <0,0,1>
}
// sphere
#declare haut = 0;
#while (haut <=4)
#declare rayon = sqrt(abs(4-(haut-2)*(haut-2)));
#declare circonf =pi*rayon*rayon;
#declare nombre = int(circonf/0.5);
#if (nombre =0)
#declare nombre = 1;
#end
#declare pas = 360/nombre;
#declare position = 0;
#declare of = 360*rand(R1);
#while (position < nombre)
#declare position = position +1;
sphere {
<rayon* cos(pas*position+of),haut,rayon*sin (pas*position+of)>,0.2
texture {
pigment {color rgb 1}
finish {reflection 1
conserve_energy
}
}
}
#end
#declare haut = haut + 0.4;
#end
//plan
plane {y,0
texture {pigment {color rgb <1,1,0>} finish {reflection 0.2
conserve_energy} }
}
//cases
#declare a=-30;
#while (a<30)
#declare a=a+1;
#declare b=-50;
#while (b<50)
#declare b=b+1;
#if (int ((a+b)/2) = (a+b)/2) // 1 case sur 2
#declare hauteur =0.1;
#if (int ((a+b)/3) = (a+b)/3)
#declare hauteur =0.2;
#end
#if (int ((a+b)/3) = (a+b)/3+1)
#declare hauteur =0.15;
#end
#if ((a=b+1) + (a=b-1) + (a=2*b) + (b=2*a))
#declare hauteur =hauteur +0.2;
#end
#if (abs(a)>5)
#declare hauteur = hauteur * abs(a)/5;
#end
#if (abs(b)>5)
#declare hauteur = hauteur * abs(b)/5;
#end
#declare hauteur = hauteur * 0.5*(1+rand(R1));
#declare couleur = rgb
<0,0,1>+0.5*rand(R1)*x+0.5*rand(R1)*y-0.5*rand(R1)*z;
box{<a-0.5,-0.1,b-0.5>,<a+0.5,hauteur,b+0.5> //case
texture {
pigment {color couleur}
finish {phong 1}
}
}
#end
#end
#end
Post a reply to this message
Attachments:
Download 'sphere reflechis.JPG' (111 KB)
Preview of image 'sphere reflechis.JPG'
|
|
|
|
I like this a lot. Has a kind of 'order from chaos' look to it. Nice work on
your first posting, and thanks much for including the scene script.
If you were to make any changes to this I will suggest having the spheres
not interact with each other. You could find many postings about such a
thing if you don't know how to go about it yourself.
Although, as it currently is, I think the merging of spheroids and no
overlap of "cases" balances the image out, in that the sphere is amorphous
and boxes crystalline in appearance. So that is actually a good thing,
probably.
Bob Hughes
Post a reply to this message
|
|
|
|
Thanks for your advices.
By the way, I understood my error : cos and sin function work in radian, not
in degrees.
Modifying this in my script gives something much better, without any
intersections.
I made tries with blobs. Must do more tries. Don't master blobs yet. Lots to
learn. I love this program...
422f4c78$1@news.povray.org...
>I like this a lot. Has a kind of 'order from chaos' look to it. Nice work
>on your first posting, and thanks much for including the scene script.
>
> If you were to make any changes to this I will suggest having the spheres
> not interact with each other. You could find many postings about such a
> thing if you don't know how to go about it yourself.
>
> Although, as it currently is, I think the merging of spheroids and no
> overlap of "cases" balances the image out, in that the sphere is amorphous
> and boxes crystalline in appearance. So that is actually a good thing,
> probably.
>
> Bob Hughes
>
>
Post a reply to this message
|
|
|
|
"bancquart.sebastien" <ban### [at] wanadoofr> wrote:
> Thanks for your advices.
>
> By the way, I understood my error : cos and sin function work in radian, not
> in degrees.
> Modifying this in my script gives something much better, without any
> intersections.
Wrapping the sin() and cos() functions like degrees(cos(radians( foo )))
blew the sphere spheres so far out they became stars. :-)
I just figured out while loops though, maybe its beyond me for the moment.
Heres an animgif of my fixing attempt. (no intersections though!)
Post a reply to this message
Attachments:
Download 'sphereonchecker.gif' (80 KB)
Preview of image 'sphereonchecker.gif'
|
|
|
|
Try just cos(radian(foo)), without the degree.
After you took the cosinus, you don't obtain an angle so you don't have to
convert back in degree.
Easier, in the script, replace "pas = 360/nombre" with "pas=2*pi/nombre"
web.422fa980547504b4e6ef12d50@news.povray.org...
> "bancquart.sebastien" <ban### [at] wanadoofr> wrote:
>> Thanks for your advices.
>>
>> By the way, I understood my error : cos and sin function work in radian,
>> not
>> in degrees.
>> Modifying this in my script gives something much better, without any
>> intersections.
>
> Wrapping the sin() and cos() functions like degrees(cos(radians( foo )))
> blew the sphere spheres so far out they became stars. :-)
>
> I just figured out while loops though, maybe its beyond me for the moment.
>
> Heres an animgif of my fixing attempt. (no intersections though!)
>
--------------------------------------------------------------------------------
Post a reply to this message
|
|