POV-Ray : Newsgroups : povray.advanced-users : Pattern showing *change* in slope : Re: Pattern showing *change* in slope Server Time
1 Jul 2024 05:37:26 EDT (-0400)
  Re: Pattern showing *change* in slope  
From: Jaime Vives Piqueres
Date: 28 Aug 2009 07:40:32
Message: <4a97c230@news.povray.org>
SharkD escribió:
> How can I create a pattern that shows the *change* in slope of a 
> heightfield. I.e., brighter where the "curvature" is greater.
> 

I used that for my hf2iso experiment:

//---------------------------------------------------
global_settings{hf_gray_16}

#include "functions.inc"

// file to extract slope from
#declare hf_file="your_hf_here"

// sloped texture with autoilluminated finish
#declare t_terrain_slope=
texture{
  pigment{
   slope y
   color_map{
    [0.00 rgb 0]
    [0.50 rgb 1]
    [0.67 rgb 1]
    [0.75 rgb 0]
    [1.00 rgb 0]
   }
  }
  finish{brilliance 0 ambient 1}
}

// create a heightfield from the bitmat
#declare terrain=
height_field{
  tga hf_file
  translate -.5
  scale <2,1,2>
  texture{t_terrain_slope}
}
object{terrain}

// take a square shot
camera{
  orthographic
  location <0,0,-1>
  up 1*y right 1*x
  angle 90
  look_at 0
  rotate 90*x
}
//---------------------------------------------------


--
Jaime


Post a reply to this message

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