POV-Ray : Newsgroups : povray.general : Question: Twisting a Heightfield? Server Time
26 Apr 2024 22:56:45 EDT (-0400)
  Question: Twisting a Heightfield? (Message 1 to 10 of 30)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Sven Littkowski
Subject: Question: Twisting a Heightfield?
Date: 6 Feb 2016 23:56:53
Message: <56b6ce95$1@news.povray.org>
Hi,

is there any way (or macro) that can twist a heightfield around the
inside of a cylinder?


Post a reply to this message

From: Alain
Subject: Re: Question: Twisting a Heightfield?
Date: 7 Feb 2016 10:47:52
Message: <56b76728@news.povray.org>
Le 16-02-06 23:56, Sven Littkowski a écrit :
> Hi,
>
> is there any way (or macro) that can twist a heightfield around the
> inside of a cylinder?
>


In the Windows vwesion, from the insert menu, look at and experiment with:
Special shapes, hight_field and HF macros, HF_Cylinder_macro
Special shapes, Mesh from meshmaker.inc, p_cylinder_cracle And 
p_cylinder_crackle_2


Alain


Post a reply to this message

From: Sven Littkowski
Subject: Re: Question: Twisting a Heightfield?
Date: 7 Feb 2016 10:57:18
Message: <56b7695e$1@news.povray.org>
Yes, I saw them already, but when I tried the HF_Cylinder macro, it
causes errors and halt. The error message is: "Parse Error: Expected
'operator', ( found instead"

I think, the included code is faulty. If this code could be fixed, I
could go ahead with it.

Here the faulty code. Can you test, if this causes errors on your
computer, too?

// -------------- HF_Cylinder macro -------------------
#declare Fn_1 =
 function(x, y, z)
  {1-(-f_snoise3d(x*3,y*3 ,  z*3)*0.8)}

// ----------------------------------------------------
object{ HF_Cylinder( Fn_1, //Function,
                        0, // UseUVheight:  0 or 1
                        1, // UseUVtexture: 0 or 1
                  <50,50>, // Resolution,
                        1, // Smooth: 0 or 1
                       "", // FileName, ""=no file,
                  <0,0,0>, // EndA,
                <0,1.5,0>, // EndB
                     1.60 ,// Radius
                      0.5  // Depth
                         ) //-------------------------
  texture{ pigment{ checker
                    color rgb<0.5,0.1,0.85>
                    color rgb<1,0.67, 0.05>
                    scale<1,2,1>*0.05}
           finish { phong 1 reflection 0.01}
         } // end of texture
  scale<1,1,1>*1
  rotate<0,0,0>
  translate<0,0.00,0>
} // end of HF_Cylinder -------------------------------


Post a reply to this message

From: William F Pokorny
Subject: Re: Question: Twisting a Heightfield?
Date: 7 Feb 2016 14:50:29
Message: <56b7a005$1@news.povray.org>
On 02/07/2016 10:56 AM, Sven Littkowski wrote:
> Yes, I saw them already, but when I tried the HF_Cylinder macro, it
> causes errors and halt. The error message is: "Parse Error: Expected
> 'operator', ( found instead"
>
> I think, the included code is faulty. If this code could be fixed, I
> could go ahead with it.
>
> Here the faulty code. Can you test, if this causes errors on your
> computer, too?

Did you include shapes.inc which defines the macro ?

Bill P.


Post a reply to this message

From: clipka
Subject: Re: Question: Twisting a Heightfield?
Date: 7 Feb 2016 15:45:16
Message: <56b7acdc$1@news.povray.org>
Am 07.02.2016 um 16:56 schrieb Sven Littkowski:
> Yes, I saw them already, but when I tried the HF_Cylinder macro, it
> causes errors and halt. The error message is: "Parse Error: Expected
> 'operator', ( found instead"

And the error location is...?


Post a reply to this message

From: Sven Littkowski
Subject: Re: Question: Twisting a Heightfield?
Date: 7 Feb 2016 22:00:20
Message: <56b804c4$1@news.povray.org>
Hi, line 5 gives that error.

In this case, the error message mentions I might have to include
"functions.inc". I did a 2nd try, now having included "functions.inc",
but that is still causing the same error message, now without mentioning
"functions.inc".

Now I followed up the advise of William F. Pokorny, and added instead
"shapes.inc" to the code. The result is, that now finally the inserted
code is complete and functional, and I get what I wanted.

My conclusion is, that the INSERT code was incomplete: the include
"shapes.inc" was missing, or at least any hint that shapes.inc has to be
included was missing. How would someone know that? I use POV-Ray since
1989 or so and didn't know it. How would any newbie using the
comfortable INSERT options know, that more is required, if this is
nowhere mentioned or done. I think, any INSERT code needs to be complete
and functional, only then it makes sense.

I advise, to add such includes to each INSERT object where applicable,
and also to add a comment behind it mentioning that the include needs to
be there only one time (in case you use more than one INSERT objects
that require the same include).


Post a reply to this message

From: Kenneth
Subject: Re: Question: Twisting a Heightfield?
Date: 8 Feb 2016 12:15:00
Message: <web.56b8cc682a0e639833c457550@news.povray.org>
Sven Littkowski <jam### [at] yahoocom> wrote:
>
> In this case, the error message mentions I might have to include
> "functions.inc". I did a 2nd try, now having included "functions.inc",
> but that is still causing the same error message, now without mentioning
> "functions.inc".
>
> Now I followed up the advise of William F. Pokorny, and added instead
> "shapes.inc" to the code. The result is, that now finally the inserted
> code is complete and functional, and I get what I wanted.
>
> My conclusion is, that the INSERT code was incomplete: the include
> "shapes.inc" was missing, or at least any hint that shapes.inc has to be
> included was missing...

I think you might be confused (?) about this. In order to use the HF_Cylinder
macro in "shapes.inc", you need to #include "shapes.inc" in your scene. (That's
covered in the documentation about #include files; and perhaps in the section
about macros too.) The macro *code* is there. Shapes.inc is available in
POV-Ray's insert menu-- at least it is in my own versions of POV-Ray. Then you
add

HF_Cylinder(...)

to your scene, to 'call' the macro, with the parameters you choose, and it makes
the (mesh) cylinder. The "shapes.inc" file has these additional #includes inside
it:

#include "shapes_old.inc"
#include "consts.inc"
#include "transforms.inc"
#include "strings.inc"
#include "math.inc"

Now, note that "math.inc" also includes "functions.inc" within itself; so you
don't have to add that.

I suspect that you initially tried to copy and paste *just* the HF_Cylinder
macro code itself into your scene (taken 'out' of shapes.inc); that would not
work, just by itself.


Post a reply to this message

From: Kenneth
Subject: Re: Question: Twisting a Heightfield?
Date: 8 Feb 2016 12:35:00
Message: <web.56b8d1812a0e639833c457550@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> I suspect that you initially tried to copy and paste *just* the HF_Cylinder
> macro code itself into your scene (taken 'out' of shapes.inc); that would not
> work, just by itself.

Sorry, I didn't look carefully at your code example before I posted my comments.
As mentioned earlier here, the only thing that's missing from your code is to
#include "shapes.inc" somewhere near the beginning of your scene file.

I've used the HF_Cylinder macro to make interesting 'cave' structures, that look
nicely organic, by combining different functions. It's quite a useful tool.


Post a reply to this message

From: Sven Littkowski
Subject: Re: Question: Twisting a Heightfield?
Date: 8 Feb 2016 13:31:30
Message: <56b8df02$1@news.povray.org>
Thanks. I just wished, the Inserts would be functional as they are,
means, they should include the contain the "shapes.inc" code.


Post a reply to this message

From: scott
Subject: Re: Question: Twisting a Heightfield?
Date: 9 Feb 2016 06:27:41
Message: <56b9cd2d$1@news.povray.org>
> Thanks. I just wished, the Inserts would be functional as they are,
> means, they should include the contain the "shapes.inc" code.

Most of the Insert items are not meant to be stand-alone scenes, but 
IMHO they should at least contain a comment that states if any include 
files are needed in the scene.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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