POV-Ray : Newsgroups : povray.binaries.images : Problem: Finding the elevation range of an isosurface relief : Re: Problem: Finding the elevation range of an isosurface relief Server Time
5 Nov 2024 12:36:29 EST (-0500)
  Re: Problem: Finding the elevation range of an isosurface relief  
From: Ray Bellis
Date: 8 Aug 2007 03:54:31
Message: <46b976b7@news.povray.org>
Ray Bellis wrote:
>
> int height = 16384;
> int step = height / 2;
> while (step >= 0) {
>  if (hit_object_at_height(height)) {
>    height += step;
>  } else {
>    height -= step;
>  }
>  step /= 2;
> }

Oops - small bug - that (step >= 0) check should be (step > 0)

Ray


Post a reply to this message

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