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
2 Aug 2024 10:18:36 EDT (-0400)
  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.