POV-Ray : Newsgroups : povray.advanced-users : How to address last 2 components of 5-component vectors? : Re: How to address last 2 components of 5-component vectors? Server Time
3 May 2024 23:56:08 EDT (-0400)
  Re: How to address last 2 components of 5-component vectors?  
From: Thomas de Groot
Date: 17 Jul 2016 03:24:05
Message: <578b3295$1@news.povray.org>
On 16-7-2016 14:47, Bald Eagle wrote:
> Sorry to keep this thing going for this long, but perhaps someone can post some
> working code to clarify HOW to use .hf "IN" (a) function.
>

I have an example right at hand. Two steps:

//step 1:
#declare F_HF_00 =
function {
   pigment {
     image_map {
       tga "MyOwn.tga" gamma 1.0
       map_type 0
       interpolate 2
     }
     warp {repeat x}
     warp {repeat y}
     scale 50
     warp {
       turbulence <1.5, 9, 1.5>
       octaves 1 //[6]
       lambda 1  //[2]
       omega 0.2 //[0.5]
     }
     scale 1/50
   }
}

//step 2:
#declare Landscape =
height_field {
   function 2000, 2000 {F_HF_00(x,y,z).hf}
   //smooth
   translate <-0.5, -0.5, -0.5>
   scale <-1, 1, 1>
   scale <MyScale, 100, MyScale>
   clipped_by {
     box {
       <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>
       scale <MyScale, 1, MyScale> * <0.99, 500, 0.99>
     }
   }
}

Note: The clipped_by line might be necessary to cut out the artefacts 
generated by the function at the borders of the height_field.


-- 
Thomas


Post a reply to this message

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