POV-Ray : Newsgroups : povray.advanced-users : tiles etc..... : Re: tiles etc..... Server Time
2 Nov 2024 05:18:33 EDT (-0400)
  Re: tiles etc.....  
From: Chris Huff
Date: 24 Mar 2000 11:52:36
Message: <chrishuff_99-7732BC.11544624032000@news.povray.org>
In article <38DB703D.AAD57708@psu.edu>, Paul Jones <pdj### [at] psuedu> 
wrote:

> I am trying to make a tiled floor with cracked or partially dissolved
> tiles. I have set up a nested #while loop which takes care of placing
> each tile based on the dimensions supplied by the user. The tiles are
> superellipsoids. Now here comes the problem... to eat away from the
> tiles I can either difference each tile with a height-field (inside the
> #while loop), or difference the whole, completed floor (all tiles are
> unioned) with one huge height-field. The problem is the parsing time,
> using the former approach, parsing times of 2-4 hours are not uncommon,
> the latter parses much quicker, but I have less control (and to a
> certain extent, quality). I want to stay away from normal modifiers
> because I want a true 3-D decayed floor. Any suggestions?

You could use isosurfaces. Even if you only use them for individual 
tiles, you can get a speed improvement(isosurface superellipsoids are 
often faster than the superellipsoid primitive). You could also make a 
bunch of tiles out of one isosurface, if you design the function 
properly. Something like this will work for that:
isosurface {
    function {abs(sin(x*pi))*abs(sin(z*pi))*abs(y)}
    threshold 0.05
    sign -1
    eval
    accuracy 0.01
    contained_by {box {<-2,-1,-2>, < 2, 0, 2>}}
    texture {
        pigment {color rgb < 0.8, 0.5, 1>}
        finish {brilliance 3}
    }
    scale < 1, 0.2, 1>
}

This parses and renders fast, and you can use difference or intersection 
to get cracks and gaps. You can also use pigments to modify the surface, 
slower rendering but potentially great results:

#declare CrackFn = function {
    pigment {crackle ramp_wave
        color_map {[0 color rgb <0,0,0>][1 color rgb <1,1,1>]}
        turbulence 0.1
    }
}

isosurface {
    function {(1-abs(sin(x*pi))*abs(sin(z*pi))*abs(y))*1.05
        &(1-CrackFn(x,y/5,z))*1.1
    }
    threshold 1
    eval
    accuracy 0.01
    contained_by {box {<-2,-1,-2>, < 2, 0, 2>}}
    texture {
        pigment {color rgb < 0.8, 0.5, 1>}
        finish {brilliance 3}
    }
    scale < 1, 0.2, 1>
}

-- 
Christopher James Huff - Personal e-mail: chr### [at] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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