POV-Ray : Newsgroups : povray.binaries.images : The Colony Ship : Re: The Colony Ship Server Time
6 Oct 2024 00:48:54 EDT (-0400)
  Re: The Colony Ship  
From: Alain
Date: 14 Feb 2016 10:57:22
Message: <56c0a3e2$1@news.povray.org>
Le 16-02-14 09:26, Sven Littkowski a écrit :
> Kenneth,
>
> See here the image. The twisted real heightfield remains gray as the
> original image is, and also does not show any heights. It is just like
> an ordinary image texture wrapped along a cylinder.
>
> I also include a down-sized version of the heightfield image (the
> original is 10,000x10,000, this one is only 1,000x1,000)
>
> Here's the code:
>
> -----------------------------------------------------------
>
> #declare Fn_1 = function
> {
>   pigment
>   {
>    image_map { jpeg "Colony Ship I - Heightfield Landscape.jpg" once
> interpolate 2 }
> // this image needs to be pi-units wide by 1.0 tall, NOT square.
>
> // You can use these two modifiers to 'reverse' the imagery, to see it
> // correctly on the INSIDE. HOWEVER, this does not reverse the *depth* of
> // the heightfield. The only way to do that (that I know of) is to invert
> // the image_map's colors (in Photoshop, for example.)
>                  //scale <-1,1,1>
>                  //translate <1,0,0>
>   }
> }
>
> #declare TheLandscape = object
> {
>   HF_Cylinder(function { Fn_1(x,y*1.7,z).gray }, // *Needs* the function
> 'wrapper' Fn_1
>

Performance tip:
When evaluating a pigment, and that pigment in in shades of gray, it's 
beter to use .red, .green or .blue instead of .gray.

This use the fact that all 3 channels always evaluate to the same value.
.gray will evaluate each channels and perform a ponderated average that 
is always the same value as the red, green and blue channels.
Using .red, .green or .blue, you only evaluate a single channel and 
don't need to do the averaging.

It ONLY work for gray levels pigments and images.


Alain


Post a reply to this message

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