POV-Ray : Newsgroups : povray.general : HF_Square Macro usage? Server Time
16 Nov 2024 01:16:33 EST (-0500)
  HF_Square Macro usage? (Message 1 to 4 of 4)  
From: Stephen R  Phillips
Subject: HF_Square Macro usage?
Date: 18 Apr 2004 12:41:06
Message: <Xns94CF75BE6AFC1cybermans.pov.posts.@203.29.75.35>
I'm attempting to use this and I seem to have failed to understand how this 
Macro works.  

What I've defined is this:
----------------------------
#declare HF_R=seed(0);

#macro HF_F(X, Y, Z)
   rand(HF_R);
#end

#declare Ground=HF_Square(HF_F, false, false, <40, 40 >, 1, "", <-20, -1, -
20>, <20, 4, 20>)

object
{
   Ground
}
----------------------------
This of course bombs completely.. so how does one use the HF_Square macro? 
It's not obvious and there are no examples I could find.

Clue me in please?

Stephen


Post a reply to this message

From: Christopher James Huff
Subject: Re: HF_Square Macro usage?
Date: 18 Apr 2004 12:53:34
Message: <cjameshuff-96F2D1.12543718042004@news.povray.org>
In article <Xns94CF75BE6AFC1cybermans.pov.posts.@203.29.75.35>,
 "Stephen R. Phillips" <cyb### [at] socketnet> wrote:

> This of course bombs completely.. so how does one use the HF_Square macro? 

You have to pass a function to the macro, you can not use a macro. For 
example:

#include "functions.h"

#declare HF_F = function {f_noise3d(x, y, z)}

#declare Ground = HF_Square(HF_F, false, false, < 40, 40>, 1, "", 
<-20,-1,-20>, <20, 4, 20>)

rand() can not currently be used in functions, but it would be fairly 
useless for this anyway.


> It's not obvious and there are no examples I could find.

Look at the shapes.pov demo scene, in the incdemo folder.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Stephen R  Phillips
Subject: Re: HF_Square Macro usage?
Date: 19 Apr 2004 00:44:50
Message: <Xns94CFF0733E542cybermans.pov.posts.@203.29.75.35>
Christopher James Huff <cja### [at] earthlinknet> wrote in
news:cjameshuff-96F2D1.12543718042004@news.povray.org: 

> You have to pass a function to the macro, you can not use a macro. For
> example:
> 
> #include "functions.h"
> 
> #declare HF_F = function {f_noise3d(x, y, z)}
> 
> #declare Ground = HF_Square(HF_F, false, false, < 40, 40>, 1, "", 
> <-20,-1,-20>, <20, 4, 20>)
> 
> rand() can not currently be used in functions, but it would be fairly 
> useless for this anyway.
> 
I noticed so I used the bump pattern :) Thanks.

> 
> Look at the shapes.pov demo scene, in the incdemo folder.
> 

This is just what I was looking for! Thanks.. looks like it works with any 
object so I could use an external height field as well.

I suppose there just was no cross reference :/


Post a reply to this message

From: Christopher James Huff
Subject: Re: HF_Square Macro usage?
Date: 19 Apr 2004 10:31:52
Message: <cjameshuff-E3FA35.10325719042004@news.povray.org>
In article <Xns94CFF0733E542cybermans.pov.posts.@203.29.75.35>,
 "Stephen R. Phillips" <cyb### [at] socketnet> wrote:

> > Look at the shapes.pov demo scene, in the incdemo folder.
> 
> This is just what I was looking for! Thanks.. looks like it works with any 
> object so I could use an external height field as well.

I'm not sure what you were trying to say here. The height field macros 
don't "work with any object"...there are separate macros specifically 
written for square, spherical, and cylindrical height fields. As for the 
"external height field", you can use an image to generate a height field 
using these macros like you would with the built-in height field 
primitive, and you can use the mesh file generated by a previous call of 
the macros, but that's it.


> I suppose there just was no cross reference :/

The documentation should probably at least mention this scene...

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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