POV-Ray : Newsgroups : povray.beta-test.binaries : Function / pattern issues. New inbuilt f_bump(). Server Time
25 Apr 2024 12:36:19 EDT (-0400)
  Function / pattern issues. New inbuilt f_bump(). (Message 1 to 1 of 1)  
From: William F Pokorny
Subject: Function / pattern issues. New inbuilt f_bump().
Date: 13 Jun 2020 10:01:47
Message: <5ee4dc4b$1@news.povray.org>
<---------------------- References. Eleven previous posts

http://news.povray.org/povray.beta-test.binaries/thread/%3C5ec3f269%241%40news.povray.org%3E/

and

http://news.povray.org/povray.beta-test.binaries/thread/%3C5ee4b9e3%40news.povray.org%3E/

In povr adding a new helper function in f_bump(). Not meant to be run 
stand alone but rather to bump (displace) a surface - or field - using a 
base function. In the attached image 4 examples displacing the surface 
of a plane where the base function is a cylinder. The bottom row a 
displacement on a sphere on left and a displacement of a 'field' 
provided by the torus to create the inner shape.

...
#declare Fn01r = function (x,y,z) { sqrt(x*x+z*z) }
#declare Fn01 = function (x,y,z) {
     y - f_bump(Fn01r(x*5,y,z*1),8,0)*0.5
}
#declare Iso99 = isosurface {
     function { Fn01(x,y,z) }
...


f_bump()
--------
Parameters:

1. Input value as provided by a base function.

2. Power of 2.0 exponent integer multiplier. For the typical rounded 
dome use 1.0. Higher values tend to square off or sharpen the result. Up 
to 20 usually OK.

3. If 0, the value is returned straight up which means the maximum value 
is ~= 0.3679.  If 1, return value is normalized to 0 to 1 range. If 2, 
the return value is normalized to a -1 to 0 range or a 0 to 1 range 
depending upon input polarity.

Notes. The bump function 'bumps' values > -1 and < 1. Other input values 
are ignored.


Bill P.


Post a reply to this message


Attachments:
Download 'story_f_bump.jpg' (46 KB)

Preview of image 'story_f_bump.jpg'
story_f_bump.jpg


 

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