POV-Ray : Newsgroups : povray.general : Heightfield and imagemap question Server Time
19 Nov 2024 07:19:13 EST (-0500)
  Heightfield and imagemap question (Message 1 to 6 of 6)  
From: Michael Smith
Subject: Heightfield and imagemap question
Date: 15 Apr 2002 16:16:21
Message: <3cbb3515$1@news.povray.org>
Stupid Question Alert!!! ;-)

Why is it when I assign an imagemap material to a heightfield (or a side of
a cube, etc.) the imagemap is tiled four times? If I add the 'once'
parameter it will only fill 1/4 of the heightfield.

How do I get the entire imagemap to cover the entire heightfield only once?

(BTW, both the image and the heightfield are square in the X and Y axis, if
that makes a difference.)

Regards,

Mike


Post a reply to this message

From: Warp
Subject: Re: Heightfield and imagemap question
Date: 15 Apr 2002 16:45:18
Message: <3cbb3bde@news.povray.org>
Read the documentation about the 'scale' transformation.

-- 
#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: Hugo
Subject: Re: Heightfield and imagemap question
Date: 15 Apr 2002 17:51:05
Message: <3cbb4b49$1@news.povray.org>
Okay stupid questions are also accepted, don't worry. How did you scale your
heightfield? Simply scale your texture in the same way, or apply the texture
*before* you scale the heightfield.

Hope this helps.  ;o)

Regards,
Hugo


Post a reply to this message

From: Dave Dunn
Subject: Re: Heightfield and imagemap question
Date: 15 Apr 2002 18:03:02
Message: <3CBB4E0F.B55F24F8@aol.com>
Michael Smith wrote:

> How do I get the entire imagemap to cover the entire heightfield only once?

You have to understand how height_fields and image maps work. The height_field
is created on a square centered at <0,0,0>, proceeding to <1,0,1>. The
image_map is created at <0,0,0>, and proceeds to <1,1,0>. The first thing you
have to do in both cases is to center the height_field by translating by
<-.5,0,-.5>, and the image_map by translating it by <-.5,-.5,0>. This should be
done before scaling. From there, it is a simple matter of rotating the
image_map x*90 to make it "lay down" onto the height_field. Hope this helps.


Post a reply to this message

From: Michael Smith
Subject: Re: Heightfield and imagemap question
Date: 15 Apr 2002 19:09:01
Message: <3cbb5d8d@news.povray.org>
Hugo wrote in message <3cbb4b49$1@news.povray.org>...

>How did you scale your heightfield?

First I should mention I'm using Moray...

I scaled the heightfield to 20, 20, 0.1.

>Simply scale your texture in the same way,

Maybe I'm missing something (well, obviously I am) but no
matter how I scale or translate the material or heightfield it
always renders the imagemap in quarters on the heightfield.

>or apply the texture *before* you scale the heightfield.

Not sure I understand.

Mike


Post a reply to this message

From: Mark Wagner
Subject: Re: Heightfield and imagemap question
Date: 16 Apr 2002 01:09:35
Message: <3cbbb20f@news.povray.org>
Michael Smith wrote in message <3cbb5d8d@news.povray.org>...
>Hugo wrote in message <3cbb4b49$1@news.povray.org>...
>
>>How did you scale your heightfield?
>
>First I should mention I'm using Moray...


There's the problem.  I'm not a regular Moray user, but I'm fairly sure that
Moray applies a "scale 2 translate <-1,-1,-1>" to any heightfield when it is
created.  To get your image to map properly, you'll need to apply the same
transformation to it.

--
Mark

The Universe is expanding.
The budget for its exploration is shrinking.


Post a reply to this message

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