POV-Ray : Newsgroups : povray.general : Spline function blending a function pattern for isosurface Server Time
26 Dec 2024 02:33:06 EST (-0500)
  Spline function blending a function pattern for isosurface (Message 1 to 1 of 1)  
From: Kalle Lappalainen
Subject: Spline function blending a function pattern for isosurface
Date: 16 Apr 2003 15:31:04
Message: <3e9daf78@news.povray.org>
Hi everyone,


I'm trying to use functions as a pattern for isosurface functions in the
same way as we use pattern functions (like bozo) in color maps to pick up a
color.

I'm going to use them in landscapes so the functions are in form

y = f(x, z)   or in other words   y - f(x, 0, z) = 0



My problem is how to use spline as a function to blend the pattern. I think
there is some syntax error in my code.

This code should place stone fields on a terrain to the places where the
pattern function get greater values than 0.6. However it dosen't work and I
don't know why... Any ideas?

-Kalle



#declare fn_Blending = function {
        spline {
                linear_spline
                0.0, <0, 0>
                0.4, <0, 0>
                0.6, <1, 0>
                1.0, <1, 0>
        }
}

#declare fn_BlendedPattern = function(x, y, z) {
fn_Blending(fn_PlacementPattern(x, y, z)).x }

isosurface {
    function {
        y - fn_BasicTerrain(x, y, z) - fn_BlendedPattern(x, y, z) *
fn_StoneField(x, y, z)
    }
    ...
}


Post a reply to this message

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