POV-Ray : Newsgroups : povray.newusers : Heighfields -are they meshes or 'just' textures? Server Time
4 Sep 2024 18:16:53 EDT (-0400)
  Heighfields -are they meshes or 'just' textures? (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: krus
Subject: Heighfields -are they meshes or 'just' textures?
Date: 14 Aug 2002 07:15:06
Message: <web.3d5a39c91ed38c652f4bd1e30@news.povray.org>
Hello all!
I'm Completely new and have been working through the tutorial and made all
the examples. I'm very interested in the Heighfields. I would so like to
use the outputs in a 3d engine as 'worlds'.
I have read the section of 'export to other formats' and it is stated there
that a special pov by Thomas Baier (POB) can export MESH obj to other
formats
Now is it want to know:
Is heightfields real meshes that can be "exported" to 3ds or .x using this
utility?

Is so.. Where can I get the utility (dead link)

regards Krus


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 14 Aug 2002 07:56:03
Message: <3d5a4553@news.povray.org>
"krus" <nomail@nomail> schrieb im Newsbeitrag
news:web.3d5a39c91ed38c652f4bd1e30@news.povray.org...
> Is heightfields real meshes that can be "exported" to 3ds or .x using this
> utility?

I'm no expert in this field, but IIRC the heightfield-primitive is
internally represented as a mesh. I don't know if this means that the
special POV can output that though.

But - there is no need for this. Have a look at the HF_Square-macro in
shapes.inc the standard distribution of V 3.5. It will build a mesh from a
user-defined function and may write it to a file. You still will have to
convert that output as it's unlikely that some other program supports
POV-meshes directly - but that shouldn't be too hard, if you know the
description of the format you want to use.

I hope that helps,

Marc-Hendrik


Post a reply to this message

From: Tom Melly
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 14 Aug 2002 08:05:21
Message: <3d5a4781$1@news.povray.org>
"krus" <nomail@nomail> wrote in message
news:web.3d5a39c91ed38c652f4bd1e30@news.povray.org...

<snip>

Hmm, a height field takes, as its input, an image.

Are you sure that program x can't do the same? Certainly Leveller (a hf
manipulation program) can do this and then let you edit the terrain and export
to other formats.


Post a reply to this message

From: krus
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 14 Aug 2002 09:05:05
Message: <web.3d5a53a1e9a1db2d2f4bd1e30@news.povray.org>
Marc-Hendrik Bremer wrote:
>"krus" <nomail[at]nomail> schrieb im Newsbeitrag
>news:web.3d5a39c91ed38c652f4bd1e30[at]news.povray.org...
>> Is heightfields real meshes that can be "exported" to 3ds or .x using this
>> utility?
>
>I'm no expert in this field, but IIRC the heightfield-primitive is
>internally represented as a mesh. I don't know if this means that the
>special POV can output that though.
>
>But - there is no need for this. Have a look at the HF_Square-macro in
>shapes.inc the standard distribution of V 3.5. It will build a mesh from a
>user-defined function and may write it to a file. You still will have to
>convert that output as it's unlikely that some other program supports
>POV-meshes directly - but that shouldn't be too hard, if you know the
>description of the format you want to use.
>
>I hope that helps,
>
>Marc-Hendrik

>>Marc thats sound VERY interesting! -But i'm not sure if i understand *s*
Certently i do NOT understand the 'function' keyword in the macro.
This is what i got:

// macros for generating various shapes
#include "shapes.inc"

  #include "colors.inc"
  #include "skies.inc"

//uses output af heightImage som heightImage.bmp


  camera{
    location <0, 2, -10>




her udelades meget af forgrunden
    angle 0
  }

  light_source{ <10000,10000,-1000000> Red }
  light_source{ <-1000,1000,-10000> Yellow }
  light_source{ <-100,100,-100> White }



height_field {
    //sys "heightImage.bmp"
    sys "textAdv.bmp"
    smooth
    pigment {White }

    translate <-.5, -.5, -.5>
    scale <17, 1.975, 17>


  #macro
//HF_Square
//(Function, UseUVheight, UseUVtexture, Res, Smooth, FileName, MnExt,
MxExt).
     HF_Square (????, false, false, <1,1>, false, "myMapMesh", 100, 100).
  #end

  }
  sky_sphere { S_Cloud4 }

//code end

could you show me what 'Function' could/should be. I've tried whith
x=1, 1*x, 0, x^1, ..all because i do not want the image to change
I get a parse-error with all the abowe
....also the four '????' do not work ;)

Thanks!! for that fast reply Both of you!

regards krus


Post a reply to this message

From: krus
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 14 Aug 2002 09:05:07
Message: <web.3d5a5572e9a1db2d2f4bd1e30@news.povray.org>
Tom Melly wrote:
>"krus" <nomail[at]nomail> wrote in message
>news:web.3d5a39c91ed38c652f4bd1e30[at]news.povray.org...
>
><snip>
>
>Hmm, a height field takes, as its input, an image.
>
>Are you sure that program x can't do the same? Certainly Leveller (a hf
>manipulation program) can do this and then let you edit the terrain and export
>to other formats.
>

>> Hi Tom
As u can see in the abowe code i am using a .bmp as the source for the HF. I
believe the u with 'program x' is referring to the program i want to use
the mesh in, but that program need a 3ds or .x file.
I do not know Leveller, But i hope the macro solution will solve my problem
Thanks for ur reply!
regard krus


Post a reply to this message

From: Tom Melly
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 14 Aug 2002 09:21:37
Message: <3d5a5961$1@news.povray.org>
"krus" <nomail@nomail> wrote in message
news:web.3d5a5572e9a1db2d2f4bd1e30@news.povray.org...

> believe the u with 'program x' is referring to the program i want to use
> the mesh in, but that program need a 3ds or .x file.
> I do not know Leveller, But i hope the macro solution will solve my problem
> Thanks for ur reply!
> regard krus
>

No problem - take a look at
http://www.daylongraphics.com/products/leveller/tour/index.htm
for a list of export options from leveller


Post a reply to this message

From: Warp
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 14 Aug 2002 11:10:59
Message: <3d5a7302@news.povray.org>
Marc-Hendrik Bremer <Mar### [at] t-onlinede> wrote:
> I'm no expert in this field, but IIRC the heightfield-primitive is
> internally represented as a mesh.

  It is internally a mesh, but the same kind of mesh which mesh/mesh2 creates.
Is an optimized one.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 14 Aug 2002 12:52:44
Message: <chrishuff-4F0BA7.11410914082002@netplex.aussie.org>
In article <web.3d5a53a1e9a1db2d2f4bd1e30@news.povray.org>,
 "krus" <nomail@nomail> wrote:

> >>Marc thats sound VERY interesting! -But i'm not sure if i understand *s*
> Certently i do NOT understand the 'function' keyword in the macro.
> This is what i got:
> 
> could you show me what 'Function' could/should be. I've tried whith
> x=1, 1*x, 0, x^1, ..all because i do not want the image to change
> I get a parse-error with all the abowe
> ....also the four '????' do not work ;)

Hmm, that's...not even close. Never used macros before?
You don't need the #macro...#end in the macro call, they are only used 
to define the macro. And you aren't supposed to use it in a 
height_field, the macro generates a new mesh primitive.

These macros are well documented in the manual, and there are examples 
in scenes/incdemo/shapes.pov. You would use something like:

#declare HF_Fn =
function {
    pigment {
        image_map {sys "textAdv.bmp" interpolate 2}
        rotate x*90
    }
}

object {
    HF_Square(function {HF_Fn(x, y, z).gray}, false, false, <100, 100>, 
true, "myMapMesh", < 0, 0, 0>, < 1, 1, 1>)
    pigment {White}
    translate <-.5, -.5, -.5>
    scale <17, 1.975, 17>
}

HF_Fn is a pigment function, it gives the color of a pigment at a point. 
The ".gray" in the function given to the macro turns it into a float 
value useable as a height. The rotation by x*90 is necessary because the 
image_map is in the xy plane and you need it in the xz plane.
You specified a mesh resolution of 1*1, which obviously won't work...I 
used 100*100, you should use something close to the size of your image 
file, though you could reduce it for lower-quality meshes. You specified 
"smooth" in your height field, so I assumed you wanted a smooth height 
field from the macro and set that option to true. And specifying "100" 
for both corners of the box containing the height field won't work, I 
specified < 0, 0, 0> and < 1, 1, 1>, like the built-in height_field 
shape.
And note that "myMapMesh" won't be affected by the texture and 
translations you do to the object. You could adjust the pigment given to 
HF_Fn and the size given to the height field macro to generate a height 
field of the desired size instead, for texturing you would have to 
manually edit the generated file, but I think the conversion program 
will ignore it anyway.

-- 
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: krus
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 15 Aug 2002 05:25:04
Message: <web.3d5b72eee9a1db2d2f4bd1e30@news.povray.org>
Christopher James Huff wrote:
>In article <web.3d5a53a1e9a1db2d2f4bd1e30[at]news.povray.org>,
> "krus" <nomail[at]nomail> wrote:
>
>> >>Marc thats sound VERY interesting! -But i'm not sure if i understand *s*
>> Certently i do NOT understand the 'function' keyword in the macro.
>> This is what i got:
>>
>> could you show me what 'Function' could/should be. I've tried whith
>> x=1, 1*x, 0, x^1, ..all because i do not want the image to change
>> I get a parse-error with all the abowe
>> ....also the four '????' do not work ;)
>
>Hmm, that's...not even close. Never used macros before?
>You don't need the #macro...#end in the macro call, they are only used
>to define the macro. And you aren't supposed to use it in a
>height_field, the macro generates a new mesh primitive.
>
>These macros are well documented in the manual, and there are examples
>in scenes/incdemo/shapes.pov. You would use something like:
>
>#declare HF_Fn =
>function {
>    pigment {
>        image_map {sys "textAdv.bmp" interpolate 2}
>        rotate x*90
>    }
>}
>
>object {
>    HF_Square(function {HF_Fn(x, y, z).gray}, false, false, <100, 100>,
>true, "myMapMesh", < 0, 0, 0>, < 1, 1, 1>)
>    pigment {White}
>    translate <-.5, -.5, -.5>
>    scale <17, 1.975, 17>
>}
>
>HF_Fn is a pigment function, it gives the color of a pigment at a point.
>The ".gray" in the function given to the macro turns it into a float
>value useable as a height. The rotation by x*90 is necessary because the
>image_map is in the xy plane and you need it in the xz plane.
>You specified a mesh resolution of 1*1, which obviously won't work...I
>used 100*100, you should use something close to the size of your image
>file, though you could reduce it for lower-quality meshes. You specified
>"smooth" in your height field, so I assumed you wanted a smooth height
>field from the macro and set that option to true. And specifying "100"
>for both corners of the box containing the height field won't work, I
>specified < 0, 0, 0> and < 1, 1, 1>, like the built-in height_field
>shape.
>And note that "myMapMesh" won't be affected by the texture and
>translations you do to the object. You could adjust the pigment given to
>HF_Fn and the size given to the height field macro to generate a height
>field of the desired size instead, for texturing you would have to
>manually edit the generated file, but I think the conversion program
>will ignore it anyway.
>
>Christopher James Huff <cja### [at] earthlinknet>
>http://home.earthlink.net/~cjameshuff/
>POV-Ray TAG: chr### [at] tagpovrayorg
>http://tag.povray.org/
>

Christopher James Huff
THANK YOU! not only for the valuable and detailed help but especially for
the hint to the examples in shapes.pov!

Still there's one problem with the code.
I do get a normal picture if i omit the filename eg:

HF_Square(function {HF_Fn(x, y, z).gray}, false, false, <100, 100>,
true, "", < 0, 0, 0>, < 1, 1, 1>)

But if i ad a file:

HF_Square(function {HF_Fn(x, y, z).gray}, false, false, <100, 100>,
true, "myMapMesh", < 0, 0, 0>, < 1, 1, 1>)

-I get a parse-error:
" expected 'object' translate found instead"

-on the other hand, a file IS made and written to hd and i have opened it
and it seams to contain the correct information:

mesh2
{
 vertex_vectors 10000,{....}//{..some thousend vectors..}
  normal_vectors 10000, {....}
 face_indices 19602, {....}
}

I do have a problem with that file though -What is the file-type (eg
extension) for this file (believe it to be a mesh2-file? a .wrl-file?)

I fear that converting does something wrong with the file because the output
3ds-file is only 1 kb and contain no information at all.

I would greatly apreciate any help

regards krus


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: Heighfields -are they meshes or 'just' textures?
Date: 15 Aug 2002 07:06:35
Message: <3d5b8b3b@news.povray.org>
"krus" <nomail@nomail> schrieb im Newsbeitrag
news:web.3d5b72eee9a1db2d2f4bd1e30@news.povray.org...

> But if i ad a file:
>
> HF_Square(function {HF_Fn(x, y, z).gray}, false, false, <100, 100>,
> true, "myMapMesh", < 0, 0, 0>, < 1, 1, 1>)
>
> -I get a parse-error:
> " expected 'object' translate found instead"
>

That's because no object is defined. The mesh is written to the file but not
build in memory. To use it you have to include it, like

object{#include"myMapMesh" translate ...}.

> I do have a problem with that file though -What is the file-type (eg
> extension) for this file (believe it to be a mesh2-file? a .wrl-file?)

It's pov-script, as if you would build the mesh by hand. I don't know if
converters exist allready, but as it's all text, it should be possible to
convert it.

Marc-Hendrik


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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