POV-Ray : Newsgroups : povray.advanced-users : Non linear object scaling Server Time
15 Oct 2024 17:58:27 EDT (-0400)
  Non linear object scaling (Message 1 to 9 of 9)  
From: yesbird
Subject: Non linear object scaling
Date: 21 Feb 2023 10:31:59
Message: <63f4e3ef$1@news.povray.org>
Hi,
Does anybody know the method of object scaling by some function,
log() , for example?
I mean scaling along the desired axis, applying scale factor, say,
to the top part of the object more than to the lower part.
--
YB


Post a reply to this message

From: Bald Eagle
Subject: Re: Non linear object scaling
Date: 21 Feb 2023 13:25:00
Message: <web.63f50be53d6c764f1f9dae3025979125@news.povray.org>
yesbird <sya### [at] gmailcom> wrote:
> Hi,
> Does anybody know the method of object scaling by some function,
> log() , for example?
> I mean scaling along the desired axis, applying scale factor, say,
> to the top part of the object more than to the lower part.
> --
> YB

Check out pg 15 of the tutorial PDF.

Non-linear scale
#declare P = function {x*x + y*y + z*z - 1}
isosurface {
function {P(x, y*(1.05-y/5), z)}
....
A non-linear stretch has turned this sphere into something like a hen's egg. The
sphere is stretched more as y
becomes larger, and compressed more as y becomes more negative.


Post a reply to this message

From: yesbird
Subject: Re: Non linear object scaling
Date: 21 Feb 2023 13:50:00
Message: <web.63f511393d6c764f9d98d1b810800fb2@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Check out pg 15 of the tutorial PDF.

Thanks, this is it !
--
YB


Post a reply to this message

From: Alain Martel
Subject: Re: Non linear object scaling
Date: 22 Feb 2023 10:07:54
Message: <63f62fca$1@news.povray.org>
Le 2023-02-21 à 10:31, yesbird a écrit :
> Hi,
> Does anybody know the method of object scaling by some function,
> log() , for example?
> I mean scaling along the desired axis, applying scale factor, say,
> to the top part of the object more than to the lower part.
> -- 
> YB
> 
For that, you need to use an isosurface equivalent of the shape.


Post a reply to this message

From: yesbird
Subject: Re: Non linear object scaling
Date: 22 Feb 2023 10:09:06
Message: <c5faa23b-7231-015a-8f86-ad1817e20f10@gmail.com>
On 21/02/2023 21:22, Bald Eagle wrote:
> Non-linear scale
> #declare P = function {x*x + y*y + z*z - 1}
> isosurface {
> function {P(x, y*(1.05-y/5), z)}
> ....
> A non-linear stretch has turned this sphere into something like a hen's egg. The
> sphere is stretched more as y
> becomes larger, and compressed more as y becomes more negative.
It works fine for isosurfaces, but is it possible to scale arbitrary
object non-linear way ?
--
YV


Post a reply to this message

From: yesbird
Subject: Re: Non linear object scaling
Date: 22 Feb 2023 10:14:14
Message: <c473ef31-3299-ffe6-6c93-350b126672d3@gmail.com>
On 22/02/2023 18:07, Alain Martel wrote:
> For that, you need to use an isosurface equivalent of the shape.
Thanks, taking into account wide specter of isosurfaces, it will be not
too difficult.
--
YB


Post a reply to this message

From: Le Forgeron
Subject: Re: Non linear object scaling
Date: 24 Feb 2023 03:58:10
Message: <63f87c22$1@news.povray.org>
Le 22/02/2023 à 16:09, yesbird a écrit :
> On 21/02/2023 21:22, Bald Eagle wrote:
>> Non-linear scale
>> #declare P = function {x*x + y*y + z*z - 1}
>> isosurface {
>> function {P(x, y*(1.05-y/5), z)}
>> ....
>> A non-linear stretch has turned this sphere into something like a 
>> hen's egg. The
>> sphere is stretched more as y
>> becomes larger, and compressed more as y becomes more negative.
> It works fine for isosurfaces, but is it possible to scale arbitrary
> object non-linear way ?

On any objects, you can only have linear transformation, because of the 
transformation arithmetic used: it's only a matrix of constant 
coefficients applied to the ray equation.

non-linear scale is only possible on object whose definition is updated 
by the operation: you get a new object.

That's what happen for isosurface by pushing the transformation over 
input data.

You can also mangle the same way the data which create mesh/mesh2 and 
maybe parametric and bicubic_patch.

I did play a bit with transforming mesh ( to get another mesh) with 
non-linear transformation on hg-povray

https://wiki.povray.org/content/User:Le_Forgeron#Getting_a_new_mesh_from_a_mesh

> https://wiki.povray.org/content/User:Le_Forgeron#Getting_a_new_mesh_from_a_mesh

and https://wiki.povray.org/content/User:Le_Forgeron/mesh

> https://wiki.povray.org/content/User:Le_Forgeron/mesh


Post a reply to this message

From: Bald Eagle
Subject: Re: Non linear object scaling
Date: 24 Feb 2023 06:25:00
Message: <web.63f89e7c3d6c764f1f9dae3025979125@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> On any objects, you can only have linear transformation, because of the
> transformation arithmetic used: it's only a matrix of constant
> coefficients applied to the ray equation.
>
> non-linear scale is only possible on object whose definition is updated
> by the operation: you get a new object.
>
> That's what happen for isosurface by pushing the transformation over
> input data.
>
> You can also mangle the same way the data which create mesh/mesh2 and
> maybe parametric and bicubic_patch.

Indeed.  Though I was thinking if there was any way to actually do this from the
source code side (at some point)

That got me thinking about the kind of "sliding scale" that could be used, and i
suppose one could loop over an object, take a very small intersection slice, and
then scale the next slice, the slice after that would get translated to
compensate for the scaling, ....  until you reached the end of the loop.

I guess it would kind of operate like I think those object bending macros work.

At least that way one could fully texture a CSG object and still "transform" it
without having to make the whole thing one monolithic object {} in the form of a
mesh or isosurface.


Post a reply to this message

From: yesbird
Subject: Re: Non linear object scaling
Date: 24 Feb 2023 07:06:32
Message: <d12ace7b-d82d-318f-7cfc-89aabcd6089b@gmail.com>
On 24/02/2023 11:58, Le_Forgeron wrote:
> I did play a bit with transforming mesh ( to get another mesh) with 
> non-linear transformation on hg-povray
> 
> https://wiki.povray.org/content/User:Le_Forgeron#Getting_a_new_mesh_from_a_mesh
> 
>> https://wiki.povray.org/content/User:Le_Forgeron#Getting_a_new_mesh_from_a_mesh
> 
> and https://wiki.povray.org/content/User:Le_Forgeron/mesh
> 
>> https://wiki.povray.org/content/User:Le_Forgeron/mesh

Hi, Le_Forgeron.
Thank you for this idea, I will try it, may be this is a solution I'm 
looking for ...
--
YB


Post a reply to this message

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