POV-Ray : Newsgroups : povray.newusers : 2 queries - heighfield and calcul value in message window : Re: 2 queries - heighfield and calcul value in message window Server Time
30 Jul 2024 20:30:02 EDT (-0400)
  Re: 2 queries - heighfield and calcul value in message window  
From: Hughes, B 
Date: 11 Sep 2003 04:20:06
Message: <3f603036@news.povray.org>
"tommy" <tom### [at] webkenyacom> wrote in message
news:web.3f60148b4d42406a472d3920@news.povray.org...
>
> Most of the time, my script contains things like :
> #declare var = 2*L+(5*l+(gap*2))).  What should I do to get the var value
in
> the message window

#debug concat ( "\n", str(var,0,-1), "\n" )

> I like to do some organic shape.  I thouhg doin it using heighfield.  Is
> there a way to give transparency to a certain level (e.g. for all value
> ranging from 0 to 0.2, give a rgbf 1) and apply an image_map to the rest.

Simply use a pigment_map. For what you ask it would be like:

#declare ClearPart=pigment {rgbf 1}
#declare ImageMap=pigment {
    image_map {jpeg "Image.jpg"}
        rotate 90*x // turn to face HF plane
}

height_field {
    png "HF.png"
pigment {
    gradient y
    pigment_map {
        [0.2 ClearPart]
        [0.2 ImageMap] // from 0.2 on upward
    }
}
}

Hopefully this is obvious and doesn't need any explanation. Although you can
also use water_level 51/256 (approx.), which will remove the lowest 5th
part, it would be better to "map" it like this anyway, since the idea is to
apply an image file within a specific range. And then again, if using a
planar map type, no matter so water_level would work in that case.

Just occured to me that I should make sure of what I'm telling you. Default
planar image maps would normally propogate infinitely in two
directions. ----- Okay, checked and it seems to do fine.

Bob H.


Post a reply to this message

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