POV-Ray : Newsgroups : povray.advanced-users : height_field + normal pattern problem.. : Re: height_field + normal pattern problem.. Server Time
8 Jul 2024 19:27:52 EDT (-0400)
  Re: height_field + normal pattern problem..  
From: Alain
Date: 1 Apr 2007 23:02:07
Message: <4610722f@news.povray.org>
albe99 nous apporta ses lumieres en ce 01-04-2007 19:16:
> Hello, I'm Alberto from Italy..
> I would want to modify an height_field with a normal pattern (granite for
> example..) and then generate a new 16 bit grayscale image (png or tga..) to
> re-use in other height_field statement..
> is possible to do this?

> I have written this basic sample:
> //------------------------------
> #include "colors.inc"

> global_settings {
>    hf_gray_16 on
> }

> camera {
>    orthographic
>    location <0.518756, 1.42622, 0.517175>
>    sky <0, 1, 0>
>    direction <0, 0, 1>
>    right <1, 0, 0>
>    up <0, 1, 0>
>    look_at <0.518487, 0.464293, 0.493562>
> }

> height_field {
>    png "HFtest01.png"
>    scale <1, 0.3, 1>
>    rotate <-90, 0, 0>
You look parallel to the Z axis, and the height_field extend along the X-Z plane 
the height been along the Y axis. The rotation is to make it perpendicular to 
the camera.
>    translate y*0.0870551

>    texture {
>       normal { granite 0.4 }
>      // pigment { color rgb <0.32549, 0.32549, 0.32549> }
Change to:
	pigment{gradient z color_map{[0 rgb 1][1 rgb 0]}
>       finish { ambient 1 }
>    }
> }
> //--------------------------------------
> ....but render shows me nothing, please can someone help me?

> Thanks, Alberto


Also, for the normal to show up, you need a light_source. Without a light, you 
can use the average function:
pigment{
	average{
	pigment_map{	[1 pigment{granite 0.4}]
			[1 pigment{gradient z color_map{[0 rgb 1][1 rgb 0]}
			}
		}
	}

-- 
Alain
-------------------------------------------------
Politicians are like diapers, they should be changed often and for the same reason.
	Bob Monkhouse


Post a reply to this message

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