POV-Ray : Newsgroups : povray.beta-test : HF Macro Opinions Server Time
29 Jul 2024 18:25:16 EDT (-0400)
  HF Macro Opinions (Message 1 to 5 of 5)  
From: Rune
Subject: HF Macro Opinions
Date: 9 Apr 2002 10:40:36
Message: <3cb2fd64@news.povray.org>
I'm rewriting the HF macros.

When using the HF macros and specifying a resolution of 20x20, what do you
want to get?

20x20 point = 19*19*2 triangles

or

21x21 points = 20*20*2 triangles

The build-in heightfield feature in POV-Ray use the first, i.e. a 20x20
pixels image give 19*19*2 triangles, but the HF macros don't nessesarily
have to work that way since samples can be taken on the fly.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:  http://rsj.mobilixnet.dk (updated Mar 19)
POV-Ray Users: http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Ring:  http://webring.povray.co.uk


Post a reply to this message

From: Tim Nikias
Subject: Re: HF Macro Opinions
Date: 9 Apr 2002 10:54:27
Message: <3CB300B8.66C3344B@gmx.de>
So, I'm not sure if this belongs into beta-test at all,
but I'd nontheless say, that 20x20 should result
in 19x19x2 triangles, because we use a 20x20 grid
for that, right?

Rune wrote:

> I'm rewriting the HF macros.
>
> When using the HF macros and specifying a resolution of 20x20, what do you
> want to get?
>
> 20x20 point = 19*19*2 triangles
>
> or
>
> 21x21 points = 20*20*2 triangles
>
> The build-in heightfield feature in POV-Ray use the first, i.e. a 20x20
> pixels image give 19*19*2 triangles, but the HF macros don't nessesarily
> have to work that way since samples can be taken on the fly.
>
> Rune

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html


Post a reply to this message

From:
Subject: Re: HF Macro Opinions
Date: 9 Apr 2002 13:38:05
Message: <ol96bu0soid36fl81mofgo0nqac9vhqihd@4ax.com>
On Tue, 9 Apr 2002 16:39:17 +0200, "Rune" <run### [at] mobilixnetdk> wrote:
> When using the HF macros and specifying a resolution of 20x20, what do you
> want to get?
> 20x20 point = 19*19*2 triangles

yes

ABX


Post a reply to this message

From: Anders K 
Subject: Re: HF Macro Opinions
Date: 9 Apr 2002 17:51:04
Message: <3cb36248$1@news.povray.org>
> When using the HF macros and specifying a resolution of 20x20, what do you
> want to get?
> 20x20 point = 19*19*2 triangles
> or
> 21x21 points = 20*20*2 triangles

I suppose it doesn't matter much, since one can always increase or decrease
the resolution by 1, but it would make more sense to me to have 20*20*2
triangles. If nothing else, I think this would simplify the macros a little
bit. (Loop i from 0 to width and j from 0 to height, taking samples at
(i/width, j/height).)

Anders

--
light_source{6#local D=#macro B(E)#macro A(D)#declare E=(E-#declare
C=mod(E D);C)/D;C#end#while(E)#if(A(8)=7)#declare D=D+2.8;#else#if(
C>2)}torus{1..2clipped_by{box{-2y}}rotate<1 0C>*90translate<D+1A(2)
*2+1#else}cylinder{0(C-v=1).2translate<D+C*A(2)A(4)#end-2 13>finish
{specular 1}pigment{rgb x}#end#end#end-8;1B(445000298)B(519053970)B
(483402386)B(1445571258)B(77778740)B(541684549)B(42677491)B(70)}


Post a reply to this message

From: David Wallace
Subject: Re: HF Macro Opinions
Date: 10 Apr 2002 10:41:41
Message: <3cb44f25@news.povray.org>
I have a more generalized parametric surface generator which outputs a mesh2
#include file.  It turns an 20x20 point grid into a 19x19x4 group of
triangles by calculating interior centers through interpolation.  Its
parameters are two filenames, one for the input data and one for the
resulting file.  For your heightfield the input file would look this:
--- Start code ---
// Parametric variable form

#declare uMin = 0.0; // Minimum u value
#declare uMax = 1.0; // Maximum u value
#declare uNum = 100; // Number of points in u direction
#declare uWrap = 0; // u wraps around if != 0
#declare uSeed = 2252; // Random number seed for u parameter

#declare vMin = 0; // Minimum v value
#declare vMax = 1.0; // Maximum v value
#declare vNum = 100; // Number of points in v direction
#declare vWrap = 0; // v wraps around if != 0
#declare vSeed = 7335; // Random number seed for v parameter

#declare IsRnd = false; // True if random number used

#declare Detail = "Partial"
/* Detail values
  Verbose = Line by line details
  Partial = Operations only
  Other = Filename only
*/

/* For all macro functions
 i = Current value of u parameter
 j = Current value of v parameter
 p = Current value of u variance (0...1)
 q = Current value of v variance (0...1)
*/

// Optional variables and subfunctions
#declare hfAltitide = function { pattern { granite } }

// point function
#macro pnt(i, j, p, q)
    <i, hfAltitide(i,0,j), j>
#end

#declare Smooth = 0; // Smooth flag
--- End code ---
I found that using an include file for large numbers of parameters is much
easier and error-free than putting all of them in the function definition.
This also gets around any difficulties with passing macro names to other
macros.

This more general macro could simply replace the HF_Macros and a few others
besides.  I could submit it to the POV-Team for inclusion if people want it.

"Tim Nikias" <tim### [at] gmxde> wrote in message
news:3CB300B8.66C3344B@gmx.de...
> So, I'm not sure if this belongs into beta-test at all,
> but I'd nontheless say, that 20x20 should result
> in 19x19x2 triangles, because we use a 20x20 grid
> for that, right?
>
> Rune wrote:
>
> > I'm rewriting the HF macros.
> >
> > When using the HF macros and specifying a resolution of 20x20, what do
you
> > want to get?
> >
> > 20x20 point = 19*19*2 triangles
> >
> > or
> >
> > 21x21 points = 20*20*2 triangles
> >
> > The build-in heightfield feature in POV-Ray use the first, i.e. a 20x20
> > pixels image give 19*19*2 triangles, but the HF macros don't nessesarily
> > have to work that way since samples can be taken on the fly.
> >
> > Rune
>
> --
> Tim Nikias
> Homepage: http://www.digitaltwilight.de/no_lights/index.html
>
>


Post a reply to this message

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