![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Content-Transfer-Encoding: 8Bit
Found an interesting shape while trying to make a sphere...
If there's a math guru out there who knows how to translate this code to
make a sphere, don't hesitate :-)
#declare Cx=-pi;
#declare Step=pi/30;
#while(Cx<pi)
#declare Cy=-pi;
#while(Cy<pi)
box {<-.04,-.04,-.04>,<.04,.04,.04>
texture { T_Gold_3C }
rotate <degrees(Cx),degrees(Cy),00>
translate <sin(Cx),cos(Cx)*(abs(Step-Cy))/2,sin(Cy)> }
#declare Cy=Cy+Step;
#end
#declare Cx=Cx+Step;
#end
--
+--------------------------------------------------------------+
| http://pingou.linux-site.net/~zebu/ ( o< =P.O.V= |
| / /\ =Perl5= |
| [ Spammers'll be eaten! ] \V_/_ =Fsims= |
+--------------------------------------------------------------+
Post a reply to this message
Attachments:
Download 'us-ascii' (126 KB)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
nice
decoded image attached..
--
Rick
Kitty5 WebDesign - http://Kitty5.com
POV-Ray News & Resources - http://Povray.co.uk
TEL : +44 (01270) 501101 - FAX : +44 (01270) 251105 - ICQ : 15776037
PGP Public Key
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x231E1CEA
Post a reply to this message
Attachments:
Download 'UNKNOWN.jpg' (92 KB)
Preview of image 'UNKNOWN.jpg'
![UNKNOWN.jpg](/povray.binaries.images/attachment/%3C3bb8f4e4%40news.povray.org%3E/UNKNOWN.jpg?ttop=443840&toff=10350&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Lovely shape !
Here's a way to make a sphere with your boxes:
#version 3.1;
#include "colors.inc"
#include "golds.inc"
#declare Cx = -pi;
#declare Step = pi/30;
#while(Cx < pi)
#declare Cy = -pi;
#while(Cy < pi)
box {
-<1, 1, 1>, <1, 1, 1>
scale 0.04
translate -y
rotate <degrees(Cx), degrees(Cy), 0>
texture { T_Gold_3C }
}
#declare Cy = Cy + Step;
#end // while
#declare Cx = Cx + Step;
#end // while
light_source { <-2, 1, -2> color White }
background { color Blue/2 }
camera {
location -3*z
look_at <0, 0, 0>
}
Tor Olav
Zebu wrote:
>
> Content-Transfer-Encoding: 8Bit
>
> Found an interesting shape while trying to make a sphere...
>
> If there's a math guru out there who knows how to translate this code to
>
> make a sphere, don't hesitate :-)
>
> #declare Cx=-pi;
>
> #declare Step=pi/30;
>
> #while(Cx<pi)
>
> #declare Cy=-pi;
>
> #while(Cy<pi)
>
> box {<-.04,-.04,-.04>,<.04,.04,.04>
>
> texture { T_Gold_3C }
>
> rotate <degrees(Cx),degrees(Cy),00>
>
> translate <sin(Cx),cos(Cx)*(abs(Step-Cy))/2,sin(Cy)> }
>
> #declare Cy=Cy+Step;
>
> #end
>
> #declare Cx=Cx+Step;
>
> #end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tor Olav Kristensen wrote:
>
> Lovely shape !
>
> Here's a way to make a sphere with your boxes:
>
> #version 3.1;
>
> #include "colors.inc"
> #include "golds.inc"
>
> #declare Cx = -pi;
> #declare Step = pi/30;
> #while(Cx < pi)
> #declare Cy = -pi;
> #while(Cy < pi)
> box {
> -<1, 1, 1>, <1, 1, 1>
> scale 0.04
> translate -y
> rotate <degrees(Cx), degrees(Cy), 0>
> texture { T_Gold_3C }
> }
> #declare Cy = Cy + Step;
> #end // while
> #declare Cx = Cx + Step;
> #end // while
>
> light_source { <-2, 1, -2> color White }
>
> background { color Blue/2 }
>
> camera {
> location -3*z
> look_at <0, 0, 0>
> }
Hmmm... That will make the boxes double up.
You better change the loop part to this:
#declare Step = pi/30;
#declare Cx = 0;
#while(Cx < pi)
#declare Cy = -pi;
#while(Cy < pi)
box {
-<1, 1, 1>, <1, 1, 1>
scale 0.04
translate y
rotate <degrees(Cx), degrees(Cy), 0>
texture { T_Gold_3C }
}
#declare Cy = Cy + Step;
#end // while
#declare Cx = Cx + Step;
#end // while
Tor Olav
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
That's a very nice notasphere :)
- Nekar
"Rick [Kitty5]" <ric### [at] kitty5 com> wrote in message
news:3bb8f4e4@news.povray.org...
> nice
>
> decoded image attached..
>
>
> --
> Rick
>
> Kitty5 WebDesign - http://Kitty5.com
> POV-Ray News & Resources - http://Povray.co.uk
> TEL : +44 (01270) 501101 - FAX : +44 (01270) 251105 - ICQ : 15776037
>
> PGP Public Key
> http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x231E1CEA
>
>
>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Zebu wrote:
>
> Content-Transfer-Encoding: 8Bit
>
> Found an interesting shape while trying to make a sphere...
>
> If there's a math guru out there who knows how to translate this code to
>
> make a sphere, don't hesitate :-)
>
Well, you could try the Pack_Sphere macro that I posted on p.t.s-f in
the 'Point distribution on a spherical shell' thread ...
Bye for now,
Mike Andrews.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi there,
I know it is alot to ask, but can you please explain this code and algorithm
in English? I don't have a very strong math background and would like to
understand how it is done. This is amazing stuff!
in article 3BB8FCF6.CF0A4C7F@hotmail.com, Tor Olav Kristensen at
tor### [at] hotmail com wrote on 10/1/01 7.32 PM:
>
> Lovely shape !
>
> Here's a way to make a sphere with your boxes:
>
> #version 3.1;
>
> #include "colors.inc"
> #include "golds.inc"
>
> #declare Cx = -pi;
> #declare Step = pi/30;
> #while(Cx < pi)
> #declare Cy = -pi;
> #while(Cy < pi)
> box {
> -<1, 1, 1>, <1, 1, 1>
> scale 0.04
> translate -y
> rotate <degrees(Cx), degrees(Cy), 0>
> texture { T_Gold_3C }
> }
> #declare Cy = Cy + Step;
> #end // while
> #declare Cx = Cx + Step;
> #end // while
>
> light_source { <-2, 1, -2> color White }
>
> background { color Blue/2 }
>
> camera {
> location -3*z
> look_at <0, 0, 0>
> }
>
>
> Tor Olav
>
>
> Zebu wrote:
>>
>> Content-Transfer-Encoding: 8Bit
>>
>> Found an interesting shape while trying to make a sphere...
>>
>> If there's a math guru out there who knows how to translate this code to
>>
>> make a sphere, don't hesitate :-)
>>
>> #declare Cx=-pi;
>>
>> #declare Step=pi/30;
>>
>> #while(Cx<pi)
>>
>> #declare Cy=-pi;
>>
>> #while(Cy<pi)
>>
>> box {<-.04,-.04,-.04>,<.04,.04,.04>
>>
>> texture { T_Gold_3C }
>>
>> rotate <degrees(Cx),degrees(Cy),00>
>>
>> translate <sin(Cx),cos(Cx)*(abs(Step-Cy))/2,sin(Cy)> }
>>
>> #declare Cy=Cy+Step;
>>
>> #end
>>
>> #declare Cx=Cx+Step;
>>
>> #end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
RTFM
The short version is this.
"#declare Cx" means create a variable
"#while" means start a conditional loop
"box" means make a box at the location set up by the math
"#declare Cx = CX + Step" increments the variable
"#end" sends it back to the #while until the condition is fulfilled
Everything else is gravy.
"Arie L. Stavchansky" <nat### [at] hotmail com> wrote in message
news:B7E8EF8C.BAD%nat### [at] hotmail com...
> Hi there,
>
> I know it is alot to ask, but can you please explain this code and
algorithm
> in English? I don't have a very strong math background and would like to
> understand how it is done. This is amazing stuff!
>
> in article 3BB8FCF6.CF0A4C7F@hotmail.com, Tor Olav Kristensen at
> tor### [at] hotmail com wrote on 10/1/01 7.32 PM:
>
> >
> > Lovely shape !
> >
> > Here's a way to make a sphere with your boxes:
> >
> > #version 3.1;
> >
> > #include "colors.inc"
> > #include "golds.inc"
> >
> > #declare Cx = -pi;
> > #declare Step = pi/30;
> > #while(Cx < pi)
> > #declare Cy = -pi;
> > #while(Cy < pi)
> > box {
> > -<1, 1, 1>, <1, 1, 1>
> > scale 0.04
> > translate -y
> > rotate <degrees(Cx), degrees(Cy), 0>
> > texture { T_Gold_3C }
> > }
> > #declare Cy = Cy + Step;
> > #end // while
> > #declare Cx = Cx + Step;
> > #end // while
> >
> > light_source { <-2, 1, -2> color White }
> >
> > background { color Blue/2 }
> >
> > camera {
> > location -3*z
> > look_at <0, 0, 0>
> > }
> >
> >
> > Tor Olav
> >
> >
> > Zebu wrote:
> >>
> >> Content-Transfer-Encoding: 8Bit
> >>
> >> Found an interesting shape while trying to make a sphere...
> >>
> >> If there's a math guru out there who knows how to translate this code
to
> >>
> >> make a sphere, don't hesitate :-)
> >>
> >> #declare Cx=-pi;
> >>
> >> #declare Step=pi/30;
> >>
> >> #while(Cx<pi)
> >>
> >> #declare Cy=-pi;
> >>
> >> #while(Cy<pi)
> >>
> >> box {<-.04,-.04,-.04>,<.04,.04,.04>
> >>
> >> texture { T_Gold_3C }
> >>
> >> rotate <degrees(Cx),degrees(Cy),00>
> >>
> >> translate <sin(Cx),cos(Cx)*(abs(Step-Cy))/2,sin(Cy)> }
> >>
> >> #declare Cy=Cy+Step;
> >>
> >> #end
> >>
> >> #declare Cx=Cx+Step;
> >>
> >> #end
>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Very cool!
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Arie L. Stavchansky" wrote:
>
> Hi there,
>
> I know it is alot to ask, but can you please explain this code and algorithm
> in English? I don't have a very strong math background and would like to
> understand how it is done. This is amazing stuff!
Hello Arie.
Sorry for not replying earlier.
I have rewritten some of the code a
little. It now uses degrees instead
of radians. And I use spheres this
time, because spheres have a simpler
syntax than boxes.
I've also split up the two while
loops so that you can see the effect
of each of them separately.
First we'll rotate a sphere, put one
unit above origo, around the x-axis
6 degrees at a time until it ends up
one unit below origo. (The y-axis is
pointing "upwards".)
#declare Step = 360/60;
#declare Cx = 0;
#while(Cx < 180)
sphere {
<0, 1, 0>, 0.06
rotate Cx*x
texture { T_Gold_3C }
}
#declare Cx = Cx + Step;
#end // while
This code will rotate a sphere, put
one unit out on the positive part
of the x-axis all the way around the
y-axis 6 degrees at the time.
#declare Step = 360/60;
#declare Cy = 0;
#while(Cy < 360)
sphere {
<1, 0, 0>, 0.06
rotate Cy*y
texture { T_Gold_1A }
}
#declare Cy = Cy + Step;
#end // while
Then we'll combine these two loops so
that one loop is inside the other.
Now, for each step the sphere is
rotated around the x-axis, it is also
taken all the way around the y-axis.
#declare Step = 360/60;
#declare Cx = 0;
#while(Cx < 180)
#declare Cy = 0;
#while(Cy < 360)
sphere {
<0, 1, 0>, 0.04
rotate Cx*x
rotate Cy*y
texture { T_Gold_2B }
}
#declare Cy = Cy + Step;
#end // while
#declare Cx = Cx + Step;
#end // while
You may also notice that it is
possible to switch places for the
two while loops. (But this way around
it is more difficult to imagine what
is really going on. =)
#declare Step = 360/60;
#declare Cy = 0;
#while(Cy < 360)
#declare Cx = 0;
#while(Cx < 180)
sphere {
<0, 1, 0>, 0.04
rotate Cx*x
rotate Cy*y
texture { T_Gold_2B }
}
#declare Cx = Cx + Step;
#end // while
#declare Cy = Cy + Step;
#end // while
I hope this helped you on the way to
understand better what's happening.
And if you have any further questions,
please feel free to ask.
Tor Olav
Btw.:
Remember to put something similar to
this at the beginning of each of my
examples above:
#version 3.1; // Or e.g. #version 3.5
#include "colors.inc"
#include "golds.inc"
light_source { <2, 1, 2> color White }
background { color Blue/2 }
camera {
location <1, 1, 3>
look_at <0, 0, 0>
}
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |