POV-Ray : Newsgroups : povray.advanced-users : Using Conditional statements with Isosurfaces (Help) Server Time
25 Nov 2024 03:37:58 EST (-0500)
  Using Conditional statements with Isosurfaces (Help) (Message 1 to 4 of 4)  
From: Rob Richards
Subject: Using Conditional statements with Isosurfaces (Help)
Date: 11 Oct 2003 12:16:32
Message: <uoagovso6q5nld89k7rkg16vgm16fpmjld@4ax.com>
Hi,

I'm wondering if it's possible to have an isosurface where a base
function has a one of two or more functions subtracted (or added)
based on the y value. I'm sure I remember seeing such a thing in the
original isosurface patch for pov 3 by R suzuki. I'm thinking of
something like the following 

isosurface{
                  function{
			f_base(x,y,z)
		      #if (y>0.5)
			-function{f_detail_1(x,y,z)*.15}
		      #else
			-function{f_detail_2(x,y,z)*.15}
		      #end
		     }

	     texture(.....}
}

But this dosn't seem to work!

Does anyone know of a way to achieve the same result ?

Thanks i advance

Rob Richards


Post a reply to this message

From: ingo
Subject: Re: Using Conditional statements with Isosurfaces (Help)
Date: 11 Oct 2003 12:26:22
Message: <Xns9411BB9353BFDseed7@netplex.aussie.org>
in news:uoagovso6q5nld89k7rkg16vgm16fpmjld@4ax.com Rob Richards wrote:

> I'm wondering if it's possible to have an isosurface where a base
> function has a one of two or more functions subtracted (or added)
> based on the y value.

select may be the thing you're looking for:
"6.1.3.6  Float Functions" select(A, B, C [,D]). 

Ingo


Post a reply to this message

From: Christoph Hormann
Subject: Re: Using Conditional statements with Isosurfaces (Help)
Date: 11 Oct 2003 13:09:44
Message: <v0ql51-nji.ln1@triton.schunter.etc.tu-bs.de>
Rob Richards wrote:
> [...]

ingo's tip is the most efficient solution, alternatively you can also use:

function{
   f_base(x,y,z)
   -(y>0.5)*f_detail_1(x,y,z)*.15
   -(y<=0.5)*f_detail_2(x,y,z)*.15
}

You should also note that f_detail_1 and f_detail_2 will have to return 
the same value on the y=0.5 plane, otherwise you will have a function 
with infinite gradient.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 2 Sep. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Using Conditional statements with Isosurfaces (Help)
Date: 11 Oct 2003 13:13:06
Message: <3f883a22@news.povray.org>
In article <uoagovso6q5nld89k7rkg16vgm16fpmjld@4ax.com> , Rob Richards 
<ari### [at] btinternetcom>  wrote:

>  I'm sure I remember seeing such a thing in the
> original isosurface patch for pov 3 by R suzuki. I'm thinking of
> something like the following

This is an illusion, you cannot have seen it because neither they syntax you
show makes any sense or did it ever exist.

As already pointed out by others, "select" is the way to go.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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