POV-Ray : Newsgroups : povray.newusers : Height_field clipped_by a box : Re: Height_field clipped_by a box Server Time
2 Jun 2024 11:55:56 EDT (-0400)
  Re: Height_field clipped_by a box  
From: Thomas de Groot
Date: 3 Sep 2012 03:20:06
Message: <50445a26@news.povray.org>
On 2-9-2012 20:23, Alain wrote:

> You clip your hight_field by a box that is 10 times to big.
>
> You need to:
> 1 - make the box buch smaller.
> OR
> 2 - Use your actual box AFTER you scale the hight_field, but before you
> move it. Also, adjust the translate by your scale.
>
> scale <14,4,14>
> clipped_by { box { <0,0,0>,<10,10,10 > }}
> translate <-0.5,0,-0.48>*14
>
>
Expanding a bit on this (see also the corresponding Docs paragraphs):

- A height_field starts as a 1x1x1 object. If you use clipped_by 
/before/ scaling the height_field it should be smaller than the unit object.

- The order in which you perform the transformations is crucial and you 
should always think about them as operating from the origin. The basic 
order is /scale/ then /rotate/ then /translate/. Any other order will 
lead to (possibly) unexpected results. Example:

box {-1, 1 rotate 45*y translate 10*x} will show a box rotated 45 
degrees around the vertical axis and translated 10 units along the x-axis.

box {-1, 1 translate 10*x rotate 45*y} will rotate a box placed at 10 
units on the +x-axis, 45 degrees towards the -z-axis.

Thomas


Post a reply to this message

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