![](/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) |
I was trying to figure out how to warp a cylinder into a sphere sweep
helix, but it didn't work. It squished the thing for some reason. My
thought was to turn the x dimension of the cylinder into the radius, and
the y dimension into the angle, but everything needs to be done
backwards. I was trying to use a rectangular to polar conversion
formula, because of things needing to be backwards.
I would appreciate it if someone could tell how to do it right. I would
also like to know how to do the same thing using parametic surfaces, and
what it was that I was doing wrong.
I think this is the code I was using.
#include "colors.inc"
#include "finish.inc"
light_source {<3,4,-5>*100 rgb 2}
camera {location <12,0,-14> look_at 0 }
#version unofficial MegaPov 0.7;
#declare Cyl= function{((x-3)^2+y^2)^.5 -1}
//plane{y,-2 pigment{White}}
#declare Cyl2 = function {Cyl(x,z*cos(pi/3) - y*sin(pi/3),
y*cos(pi/3) + z*sin(pi/3))}
#declare Cir = function{(x*cos(y)+x*sin(y))}
#declare Cir2 = function{Cyl2(sqr(x^2+y^2),atan2(x,y),z)}
isosurface{
function {Cir2(x,y,z)}
contained_by{box{-2*pi,2*pi}}
method 2
eval
pigment{Green}
finish{Shiny}
}
--
Dan Johnson
http://www.geocities.com/zapob
Post a reply to this message
Attachments:
Download 'isofailure.jpg' (15 KB)
Preview of image 'isofailure.jpg'
![isofailure.jpg](/povray.binaries.images/attachment/%3C3C46BBBA.702A824A%40hotmail.com%3E/isofailure.jpg?ttop=443840&toff=9850&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) |
Dan Johnson wrote:
>
> I was trying to figure out how to warp a cylinder into a sphere sweep
> helix, but it didn't work. It squished the thing for some reason. My
> thought was to turn the x dimension of the cylinder into the radius, and
> the y dimension into the angle, but everything needs to be done
> backwards. I was trying to use a rectangular to polar conversion
> formula, because of things needing to be backwards.
>
> I would appreciate it if someone could tell how to do it right. I would
> also like to know how to do the same thing using parametic surfaces, and
> what it was that I was doing wrong.
>
Why don't you use a built in helix function:
http://users.skynet.be/smellenbergh/buildin.html#Helix1
You can of course do it by hand, but this is a bit complicated, have a
look at the megapov source if you want to know.
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
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) |
>
> Why don't you use a built in helix function:
Can I blob together the built in function? I did know there is a built
in function, but that takes the understanding out of it.
>
> http://users.skynet.be/smellenbergh/buildin.html#Helix1
>
> You can of course do it by hand, but this is a bit complicated, have a
> look at the megapov source if you want to know.
Do you mean the C source code, or scene description language?
>
> Christoph
>
> --
> Christoph Hormann <chr### [at] gmx de>
> IsoWood include, radiosity tutorial, TransSkin and other
> things on: http://www.schunter.etc.tu-bs.de/~chris/
--
Dan Johnson
http://www.geocities.com/zapob
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) |
Dan Johnson wrote:
>
> >
> > Why don't you use a built in helix function:
>
> Can I blob together the built in function?
>
Why not?
> > You can of course do it by hand, but this is a bit complicated, have a
> > look at the megapov source if you want to know.
>
> Do you mean the C source code, or scene description language?
The C source (it's the file 'isofunc.c' in megapov)
Christoph
--
Christoph Hormann <chr### [at] gmx de>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
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) |
Dan Johnson wrote:
>
> I was trying to figure out how to warp a cylinder into a sphere sweep
> helix, but it didn't work. It squished the thing for some reason. My
> thought was to turn the x dimension of the cylinder into the radius, and
> the y dimension into the angle, but everything needs to be done
> backwards. I was trying to use a rectangular to polar conversion
> formula, because of things needing to be backwards.
>
> I would appreciate it if someone could tell how to do it right. I would
> also like to know how to do the same thing using parametic surfaces, and
> what it was that I was doing wrong.
>
> I think this is the code I was using.
>
> #include "colors.inc"
> #include "finish.inc"
> light_source {<3,4,-5>*100 rgb 2}
> camera {location <12,0,-14> look_at 0 }
>
> #version unofficial MegaPov 0.7;
>
> #declare Cyl= function{((x-3)^2+y^2)^.5 -1}
> //plane{y,-2 pigment{White}}
> #declare Cyl2 = function {Cyl(x,z*cos(pi/3) - y*sin(pi/3),
> y*cos(pi/3) + z*sin(pi/3))}
> #declare Cir = function{(x*cos(y)+x*sin(y))}
> #declare Cir2 = function{Cyl2(sqr(x^2+y^2),atan2(x,y),z)}
I just had a very brief look at your code,
and right now I don't know if what you are
doing here are the right way to go.
(I'm not even sure if I understand what
shape you are trying make. Maybe I can
look at it tomorrow.)
BUT if you are doing conversion from
rectangular to polar coordinates, then
this expression looks suspicious:
> #declare Cir2 = function{Cyl2(sqr(x^2+y^2),atan2(x,y),z)}
Shouldn't sqr(x^2+y^2) be sqrt(x^2 + y^2) ?
And this function:
> #declare Cir = function{(x*cos(y)+x*sin(y))}
is equivalent to this function:
#declare Cir = function { x*(cos(y) + sin(y)) }
Was that your intention ?
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) |