POV-Ray : Newsgroups : povray.general : scaling & translation Server Time
1 Nov 2024 05:23:43 EDT (-0400)
  scaling & translation (Message 1 to 3 of 3)  
From: Bald Eagle
Subject: scaling & translation
Date: 12 Aug 2013 21:15:01
Message: <web.520987b81ea90ac973fc9ebb0@news.povray.org>
I'm dabbling with a height_field, and when I scale the object (y*30), POV-Ray
seems to delight in driving me BSC by translating the heightfield as well.

I could probably spend a lot of time deriving and defining this behaviour, but
could someone explain the ins & outs of why some things just get scaled, and
other seem to get translated as well?


Post a reply to this message

From: Anthony D  Baye
Subject: Re: scaling & translation
Date: 12 Aug 2013 21:55:01
Message: <web.5209910493302c68328783aa0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I'm dabbling with a height_field, and when I scale the object (y*30), POV-Ray
> seems to delight in driving me BSC by translating the heightfield as well.
>
> I could probably spend a lot of time deriving and defining this behaviour, but
> could someone explain the ins & outs of why some things just get scaled, and
> other seem to get translated as well?

height_field objects are constructed from <0,0,0> to <1,0,1> so you need to
translate the object by <-0.5, 0.0, -0.5> before scaling.

The same is true for the image_map pattern, except that it is in the x,y plane
instead of the x,z plane.

Regards,
A.D.B.


Post a reply to this message

From: Larry Hudson
Subject: Re: scaling & translation
Date: 12 Aug 2013 23:58:48
Message: <5209aef8$1@news.povray.org>
On 08/12/2013 06:11 PM, Bald Eagle wrote:
>
> I'm dabbling with a height_field, and when I scale the object (y*30), POV-Ray
> seems to delight in driving me BSC by translating the heightfield as well.
>
> I could probably spend a lot of time deriving and defining this behaviour, but
> could someone explain the ins & outs of why some things just get scaled, and
> other seem to get translated as well?
>
>
The key is that scaling and rotation are done relative to the axes, NOT relative to
the object 
itself.  IOW, for example, if you have an object that is not at the origin and you
scale it by 
0.5, it not only becomes half the size, it also moves half way to the origin. 
Similarly, a 
rotation will make the object orbit the origin.

The advice is always:  Build your object at the coordinate origin, then scale and
rotate as 
necessary, and finally translate it to the location you want.

For grins, try a simple test scene of a box 5 units along the x axis.  Scale it by
<0.5, 1, 1> 
and rotate by <0, 0, 45> and see what you get.  Then try again by reversing the order
of the 
scale and rotate.  You might find it enlightening.  ;-)  To be even clearer, throw in
three 
skinny cylinders to represent the three axes.

      -=- Larry -=-


Post a reply to this message

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