POV-Ray : Newsgroups : povray.advanced-users : Unregular Scaling of an object Server Time
26 Dec 2024 01:53:29 EST (-0500)
  Unregular Scaling of an object (Message 1 to 6 of 6)  
From: Sven Littkowski
Subject: Unregular Scaling of an object
Date: 2 Aug 2005 17:40:00
Message: <web.42efe76fe33937bbbca87dd00@news.povray.org>
Hi.

I want to apply an unregular scaling to an object.

Example:

I have a box, bottom on Y=0 and top on Y=1. I want to scale the box along
the Z-axis, but in a way that the top of the box (at Y=1) is scaled by the
factor of 2, and the bottom of the box (at Y=0) by the factor of 1 (no
scale).

The result should be a box whit a Z-side which is not anymore vertical but
diagonal.

I know that Povray knows macros and functions but I am not certain what
would be the solution.

Thank you very much for your help.

Sven Littkowski


Post a reply to this message

From: Slime
Subject: Re: Unregular Scaling of an object
Date: 2 Aug 2005 17:58:01
Message: <42efec69@news.povray.org>
> I have a box, bottom on Y=0 and top on Y=1. I want to scale the box along
> the Z-axis, but in a way that the top of the box (at Y=1) is scaled by the
> factor of 2, and the bottom of the box (at Y=0) by the factor of 1 (no
> scale).

This can't be done directly in POV-Ray. POV-Ray only supports linear
transformations, which basically means (for your example) that if the far
side of the box is diagonal, the near side of the box is going to be
diagonal too. You can't do an "uneven scaling."

If you're really only concerned about boxes, then the shape you described
could be made instead with CSG. If you're working with more complex shapes,
you may have to model them as an isosurface, since you *can* apply any sort
of transformation you want to an isosurface function.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Alain
Subject: Re: Unregular Scaling of an object
Date: 3 Aug 2005 19:14:53
Message: <42f14fed$1@news.povray.org>
Slime nous apporta ses lumieres en ce 2005-08-02 17:57:
>>I have a box, bottom on Y=0 and top on Y=1. I want to scale the box along
>>the Z-axis, but in a way that the top of the box (at Y=1) is scaled by the
>>factor of 2, and the bottom of the box (at Y=0) by the factor of 1 (no
>>scale).
> 
> 
> This can't be done directly in POV-Ray. POV-Ray only supports linear
> transformations, which basically means (for your example) that if the far
> side of the box is diagonal, the near side of the box is going to be
> diagonal too. You can't do an "uneven scaling."
> 
> If you're really only concerned about boxes, then the shape you described
> could be made instead with CSG. If you're working with more complex shapes,
> you may have to model them as an isosurface, since you *can* apply any sort
> of transformation you want to an isosurface function.
> 
>  - Slime
>  [ http://www.slimeland.com/ ]
> 
> 
I know! Once, I've done a inversely proportional scaling relative to a plane on an
isosurface.

Alain


Post a reply to this message

From: Kenneth
Subject: Re: Unregular Scaling of an object
Date: 4 Oct 2005 14:35:00
Message: <web.4342ca1ef781fe2c55cad30e0@news.povray.org>
> > If you're working with more complex shapes,
> > you may have to model them as an isosurface, since you *can* apply any sort
> > of transformation you want to an isosurface function.
> >
> >  - Slime
> >  [ http://www.slimeland.com/ ]
> >

But isn't the isosurface shape itself always "constrained by" the box or
sphere CONTAINER that always has to accompany it? I admit I've only done a
few isosurface tests , but this container object *seems* to limit an
isosurface shape to being either "box-like" or "sphere-like." Am I wrong
about that? Is there actually a way around that limitation, to get much
more complex shapes and geometry?


Post a reply to this message

From: Slime
Subject: Re: Unregular Scaling of an object
Date: 4 Oct 2005 21:23:42
Message: <43432b1e$1@news.povray.org>
> But isn't the isosurface shape itself always "constrained by" the box or
> sphere CONTAINER that always has to accompany it? I admit I've only done a
> few isosurface tests , but this container object *seems* to limit an
> isosurface shape to being either "box-like" or "sphere-like." Am I wrong
> about that? Is there actually a way around that limitation, to get much
> more complex shapes and geometry?


Usually you just make the container bigger than the object before doing
weird transformations to it. As long as the object doesn't *rely* on the
container object for its shape, this isn't a problem. This is the case for
most isosurface functions, especially those made with IsoCSG.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Matt Denham
Subject: Re: Unregular Scaling of an object
Date: 24 Nov 2005 13:30:00
Message: <web.4386068ff781fe2c74f3166b0@news.povray.org>
"Sven Littkowski" <wrt### [at] yahoocom> wrote:
> Hi.
>
> I want to apply an unregular scaling to an object.
>
> Example:
>
> I have a box, bottom on Y=0 and top on Y=1. I want to scale the box along
> the Z-axis, but in a way that the top of the box (at Y=1) is scaled by the
> factor of 2, and the bottom of the box (at Y=0) by the factor of 1 (no
> scale).
>
> The result should be a box whit a Z-side which is not anymore vertical but
> diagonal.
>
> I know that Povray knows macros and functions but I am not certain what
> would be the solution.
>
> Thank you very much for your help.
>
> Sven Littkowski

Unfortunately, this transformation is 2nd-order (vs. matrix, which covers
all of the 1st-order transformations - rotates, uniform scales,
translations, shears, etc.), as you'd need to multiply the Z coordinate by
a value based off the Y coordinate.  matrix can't produce the necessary yz
term required; you're out of luck here, as it's not gonna work without
someone producing a patch capable of higher-order well-behaved (i.e.
integer exponents only) transforms - I'd consider doing it myself, but
there's no way I could actually put it through testing for a couple of
weeks minimum.

If there's any actual call for this kind of addition (not just one or two
people who can't figure out how to rework the whole thing), though, I'd be
up for trying to code it...

(BTW: for anything that's not sharp-edged, you can pull off these types of
transforms without too much trouble, though the equations get hairy on
occasion - just use an isosurface and make the substitutions as necessary.
Transforming anything with a sharp edge [e.g. cubes, cones, cylinders] is
somewhat more problematic, as they're not easily defined with an
isosurface.)


Post a reply to this message

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