POV-Ray : Newsgroups : povray.newusers : Uneven Scaling on the Y-Axis Server Time
25 Nov 2024 15:30:14 EST (-0500)
  Uneven Scaling on the Y-Axis (Message 1 to 8 of 8)  
From: Potato Man
Subject: Uneven Scaling on the Y-Axis
Date: 30 Jul 2005 11:10:01
Message: <web.42eb970e565b1578e3c9ddca0@news.povray.org>
The post title is really my question this time:

How do you get uneven scaling on the Y-Axis?  See, what I'm trying to do (to
sort of introduce myself to POV-Ray) is make a Go board.  If you don't know
what Go is, go to http://www.pandanet.co.jp/English/  The pieces for go are
essentially spheres, but they have flat bottoms, sort of like mancala
pieces.  I'm supposing it is possible to do in POV-Ray but I don't know
how.  Can anyone help me out on this?


Post a reply to this message

From: Daniel Hulme
Subject: Re: Uneven Scaling on the Y-Axis
Date: 30 Jul 2005 12:37:17
Message: <20050730173717.25f8416e@dh286.pem.cam.ac.uk>
> The post title is really my question this time:
> 
> How do you get uneven scaling on the Y-Axis?  See, what I'm trying to
> do (to sort of introduce myself to POV-Ray) is make a Go board.  If
> you don't know what Go is, go to http://www.pandanet.co.jp/English/ 
> The pieces for go are essentially spheres, but they have flat bottoms,
> sort of like mancala pieces.  I'm supposing it is possible to do in
> POV-Ray but I don't know how.  Can anyone help me out on this?
Look through the archives on these newsgroups. Goban are very popular
topics for POVers.

-- 
There may come a time                           The open palm of desire,
When I will lose you,  ]http://surreal.istic.org/[  The rose of Jericho,
Lose you as I lose my sight,                     Soil as soft as Summer,
Days falling backward into velvet night;     The strength to let you go.


Post a reply to this message

From: Christoph Hormann
Subject: Re: Uneven Scaling on the Y-Axis
Date: 30 Jul 2005 12:55:01
Message: <dcgb8r$1e$1@chho.imagico.de>
Potato Man wrote:
> The post title is really my question this time:
> 
> How do you get uneven scaling on the Y-Axis?

Not at all - uneven scaling would be a nonlinear transform and this 
isn't possible in a raytracer.  See

http://tag.povray.org/povQandT/languageQandT.html#bending

for details.

> See, what I'm trying to do (to
> sort of introduce myself to POV-Ray) is make a Go board.  If you don't know
> what Go is, go to http://www.pandanet.co.jp/English/  The pieces for go are
> essentially spheres, but they have flat bottoms, sort of like mancala
> pieces.  I'm supposing it is possible to do in POV-Ray but I don't know
> how.  Can anyone help me out on this?

I seriously doubt Go pieces are in fact continuously unevenly scaled 
spheres - if they were it would be quite difficult to create the forms 
to manufacture them.  More likely they are composed from a differently 
scaled upper and lower half - you can do this with CSG in POV-Ray.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 24 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: kurtz le pirate
Subject: Re: Uneven Scaling on the Y-Axis
Date: 30 Jul 2005 13:04:15
Message: <kurtzlepirate-AAD91C.19041430072005@news.povray.org>
In article <dcgb8r$1e$1@chho.imagico.de>,
 Christoph Hormann <chr### [at] gmxde> wrote:

::Potato Man wrote:
::> The post title is really my question this time:
::> 
::> How do you get uneven scaling on the Y-Axis?
::
::Not at all - uneven scaling would be a nonlinear transform and this 
::isn't possible in a raytracer.  See
::
::http://tag.povray.org/povQandT/languageQandT.html#bending
::
::for details.
::
::> See, what I'm trying to do (to
::> sort of introduce myself to POV-Ray) is make a Go board.  If you don't know
::> what Go is, go to http://www.pandanet.co.jp/English/  The pieces for go are
::> essentially spheres, but they have flat bottoms, sort of like mancala
::> pieces.  I'm supposing it is possible to do in POV-Ray but I don't know
::> how.  Can anyone help me out on this?
::
::I seriously doubt Go pieces are in fact continuously unevenly scaled 
::spheres - if they were it would be quite difficult to create the forms 
::to manufacture them.  More likely they are composed from a differently 
::scaled upper and lower half - you can do this with CSG in POV-Ray.
::
::Christoph

you are right christoph but a first approximation for a newbie can be :
  sphere { pos, radius scale <1, 0.10, 1> } 

klp


Post a reply to this message

From: Mike Williams
Subject: Re: Uneven Scaling on the Y-Axis
Date: 30 Jul 2005 16:28:59
Message: <JJqx9DA$I+6CFwCH@econym.demon.co.uk>
Wasn't it Christoph Hormann who wrote:
>Potato Man wrote:
>> The post title is really my question this time:
>> 
>> How do you get uneven scaling on the Y-Axis?
>
>Not at all - uneven scaling would be a nonlinear transform and this 
>isn't possible in a raytracer.  See

It is, however, quite easy in POV to perform non-linear transformations
on isosurfaces. The original poster wants to perform the non-linear
transformation on a sphere, so there's no problem creating an isosurface
to apply the non-linear transformation to.


#declare  Sphere = function {x*x + y*y + z*z - 1}

isosurface {
  function { Sphere(x,y*(2.5-y*0.8),z) }
  max_gradient 4
  contained_by{sphere{0,1}}
  pigment {rgb 1}
}

Adjust the "2.5" to change the overall vertical scale.
Adjust the "0.8" to change how much the top differs from the bottom.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christoph Hormann
Subject: Re: Uneven Scaling on the Y-Axis
Date: 30 Jul 2005 23:20:02
Message: <dcgqbm$96h$1@chho.imagico.de>
Mike Williams wrote:
> 
> It is, however, quite easy in POV to perform non-linear transformations
> on isosurfaces. The original poster wants to perform the non-linear
> transformation on a sphere, so there's no problem creating an isosurface
> to apply the non-linear transformation to.
> 
> 
> #declare  Sphere = function {x*x + y*y + z*z - 1}
> 
> isosurface {
>   function { Sphere(x,y*(2.5-y*0.8),z) }
>   max_gradient 4
>   contained_by{sphere{0,1}}
>   pigment {rgb 1}
> }
> 
> Adjust the "2.5" to change the overall vertical scale.
> Adjust the "0.8" to change how much the top differs from the bottom.
> 

Although it will be quite a bit faster if you use the internal function 
f_sphere().  Using a minimum size box container could also be more 
efficient.

:-)

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 24 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Mike Williams
Subject: Re: Uneven Scaling on the Y-Axis
Date: 31 Jul 2005 14:37:02
Message: <Sgan3HA6SH7CFwah@econym.demon.co.uk>
Wasn't it Christoph Hormann who wrote:
>Mike Williams wrote:
>> 
>> It is, however, quite easy in POV to perform non-linear transformations
>> on isosurfaces. The original poster wants to perform the non-linear
>> transformation on a sphere, so there's no problem creating an isosurface
>> to apply the non-linear transformation to.
>> 
>> 
>> #declare  Sphere = function {x*x + y*y + z*z - 1}
>> 
>> isosurface {
>>   function { Sphere(x,y*(2.5-y*0.8),z) }
>>   max_gradient 4
>>   contained_by{sphere{0,1}}
>>   pigment {rgb 1}
>> }
>> 
>> Adjust the "2.5" to change the overall vertical scale.
>> Adjust the "0.8" to change how much the top differs from the bottom.
>> 
>
>Although it will be quite a bit faster if you use the internal function 
>f_sphere().

That gives a speed increase of about 6%. (It's hard to be exact because
it's highly dependent on the values of max_gradient, which are not the
same in the two cases. The max_gradient values suggested by POV vary
slightly depending on the exact details of the scene)

>  Using a minimum size box container could also be more 
>efficient.

As it happens, that doesn't give any speed improvement at all, and
actually makes it run slower if you don't adjust the max_gradient to the
lower value that POV suggests when using the box container.

But actually, that tells us that we can get away with this lower value
of max_gradient when using a spherical container, because the highest
gradient that POV finds inside the sphere must be well outside the
surface. That gives a speed increase of about 13%.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christoph Hormann
Subject: Re: Uneven Scaling on the Y-Axis
Date: 31 Jul 2005 14:55:02
Message: <dcj6gu$iok$1@chho.imagico.de>
Mike Williams wrote:
>>
>>Although it will be quite a bit faster if you use the internal function 
>>f_sphere().
> 
> 
> That gives a speed increase of about 6%. (It's hard to be exact because
> it's highly dependent on the values of max_gradient, which are not the
> same in the two cases. The max_gradient values suggested by POV vary
> slightly depending on the exact details of the scene)

Of course they do - they are estimations based on the performed function 
evaluations.

The real gradient of the f_sphere() function is constant and exactly one 
- the non-uniform scaling of course changes that.  The gradient of your 
function is non-constant and much larger in some parts of the container.

So using the internal f_sphere() function instead of your variant is 
especially efficient if you use a too large container like in your code.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 24 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

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