POV-Ray : Newsgroups : povray.bugreports : CLipka: Possible BUG Found!!! :-) : Re: CLipka: Possible BUG Found!!! :-) Server Time: 21 Jul 2019 01:00:30 GMT
  Re: CLipka: Possible BUG Found!!! :-)  
From: clipka
Date: 12 Feb 2016 19:41:47
Am 12.02.2016 um 10:35 schrieb Sven Littkowski:
> and once again I gladly report a possible BUG! At least, it seems to be
> a bug, let's see.

Guess what: Again it isn't :P

> But using now a heightfield, I get an error message.
> 
> object
> {
>  HF_Cylinder( Fn_1, // Function,
>                  0, // UseUVheight:  0 or 1
>                  1, // UseUVtexture: 0 or 1
>            <50,50>, // Resolution,
>                  1, // Smooth: 0 or 1
>  "Colony Ship I - Heightfield Landscape.png", // FileName, ""=no file,
>            <0,0,0>, // EndA,
>          <0,1.5,0>, // EndB
>               1.60 ,// Radius
>                0.05  // Depth
>              ) //-------------------------
>  scale < 0.58, 0.67, 0.58 >  // error here when using a heightfield
>  rotate < 90.0, 0.0, 0.0 >
>  scale < 1500.0, 1500.0, 2500.0 >
> }

You've misunderstood the FileName parameter.

From the documentation:

------------------------------------
There are several HF macros in shapes.inc, which generate meshes in
various shapes. All the HF macros have these things in common:

* The HF macros do NOT DIRECTLY USE AN IMAGE for input, but evaluate a
user-defined function. The macros deform the surface based on the
function values.
* The macros can either WRITE TO A FILE to be included later, or create
an object directly. If you want to output to a file, simply specify a
filename. If you want to create an object directly, specify "" as the
file name (an empty string).
...
------------------------------------

Specifying a FileName would be useful in animations, or if your
(pseudo-) height field is so large that you don't want it to be
re-computed each time you render the scene, e.g.:

    #declare RecomputeHFCylinder = (clock = 0);

    #if (RecomputeHFCylinder)
      HF_Cylinder( ..., "Foo.inc", ...)
    #end

    object {
      #include "Foo.inc"
      scale ...
    }

Note that when used in this mode, the HF_Cylinder(...) macro does not
evaluate to an object, but simply generates the specified file as a side
effect, so your code

    object {
      HF_Cylinder( ..., "Heightfield Landscape.png", ...)
      scale ...
    }

will evaluate to

    object {
      scale ...
    }

while at the same time overwriting(!) the file "Heightfield
Landscape.png" with plain text reading:

    mesh2 {...}


To generate a HF_Cylinder from an image, you'd need to use a pigment
function.


> PITA nomination?   :-)

Absolutely ;)


Post a reply to this message

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