POV-Ray : Newsgroups : povray.advanced-users : Unregular Scaling of an object : Re: Unregular Scaling of an object Server Time
28 Jul 2024 12:31:22 EDT (-0400)
  Re: Unregular Scaling of an object  
From: Matt Denham
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.