POV-Ray : Newsgroups : povray.newusers : Add a Gif as Texture Server Time
27 Nov 2024 02:54:09 EST (-0500)
  Add a Gif as Texture (Message 1 to 5 of 5)  
From: Maik Schmidt
Subject: Add a Gif as Texture
Date: 21 Jun 2003 10:48:46
Message: <3ef4704e$1@news.povray.org>
Hi.

I'm trying to get a gif file into my raytraced picture. I want to place 
it as some typ of sign but somehow I don't get it working. I only get a 
blank plane with this source code:

----
#include "colors.inc"
global_settings { ambient_light rgb<1, 1, 1> }
light_source {
     <1, 1, 1>
     color White
}
camera {
     location <0, 3, 0>
     look_at  <0, 0, 0>
}
plane {
         <0, 1, 0>,0
         texture {
           pigment {
             image_map {
               gif "test.gif"
             }
           }
         }
}
----

The gif file is the logo in the upper right portion of 
http://www.daani.de/. I just renamed it for my purpose.

And I just do not know where my error is.

Greetings,
Maik Schmidt


Post a reply to this message

From: Hughes, B 
Subject: Re: Add a Gif as Texture
Date: 21 Jun 2003 11:10:50
Message: <3ef4757a$1@news.povray.org>
plane {
          <0, 1, 0>,0
          texture {
            pigment {
              image_map {
                gif "test.gif"
              }
    translate -0.5 scale 1 rotate 90*x
            }
          }
 }

is what you are needing if you want it centered and showing as a floor or
ceiling oriented image. To explain further, you would need to adjust
position (size too) from the pigment statement for a y plane like yours. The
default is for z plane instead, with the lower left corner being at <0,0,0>
then up and right one unit to <1,1,0>. The depth infinite along z. Notice
that you transform it from the pigment statement and not from the image_map
statement. However, you'll need to add the keyword 'once' to image_map to
prevent tiling.

My translate -0.5 infers a <-0.5,-0.5,-0.5>, where z doesn't matter since it
will project all along that axis, so that it will be centered and when
scaling will expand or contract from the <0,0,0> coordinate and also rotate
around that point instead of a corner of the image. For me that's the
easiest way to work with it, you could do it differently if you like. Main
thing is that you understand the the defaults for image_map are to place it
on the z plane going from <0,0,0> to <1,1,0>. You've simply ended up with a
image as an infinitely small line across a y plane so it's invisible.

Bob H.


Post a reply to this message

From: Maik Schmidt
Subject: Re: Add a Gif as Texture
Date: 22 Jun 2003 06:23:23
Message: <3ef5839b@news.povray.org>
Hi,

Hughes, B. wrote:
> is what you are needing if you want it centered and showing as a floor or
> ceiling oriented image. To explain further, you would need to adjust
> position (size too) from the pigment statement for a y plane like yours. The
> default is for z plane instead, with the lower left corner being at <0,0,0>
> then up and right one unit to <1,1,0>.

Thank you. Now it works fine.. I've just overviewed this 90 degree turn 
of my plane.

I can finish my macro now...

Greetings,
Maik Schmidt
-- 
http://home.t-online.de/home/callan/container2.gif


Post a reply to this message

From: skrillian
Subject: Re: Add a Gif as Texture
Date: 23 Jun 2003 02:11:23
Message: <3ef69a0b$1@news.povray.org>
On Sun, 22 Jun 2003 06:23:56 -0400, Maik Schmidt wrote:

> Hi,
> 
> Hughes, B. wrote:
>> is what you are needing if you want it centered and showing as a floor
>> or ceiling oriented image. To explain further, you would need to adjust
>> position (size too) from the pigment statement for a y plane like
>> yours. The default is for z plane instead, with the lower left corner
>> being at <0,0,0> then up and right one unit to <1,1,0>.
> 
> Thank you. Now it works fine.. I've just overviewed this 90 degree turn
> of my plane.
> 
> I can finish my macro now...

	I find this to be more generally useful. 

mesh {
triangle{<-1,1,0> <1,1,0> <-1,-1,0>}
triangle{<-1,-1,0> <1,1,0> <1,-1,0>}
texture {pigment {image_map{png "image.png"
once map_type 0}} }
finish{ambient .6 roughness .01}  }

	It is finite and scalable to the size of the image and so forth. And if
you make a finer mesh and apply a sine wave you can make it wave like a
flag in the wind.


Post a reply to this message

From: Maik Schmidt
Subject: Re: Add a Gif as Texture
Date: 23 Jun 2003 10:08:14
Message: <3ef709ce@news.povray.org>
Hi.

skrillian wrote:
>>>is what you are needing if you want it centered and showing as a floor
>>>or ceiling oriented image. To explain further, you would need to adjust
>>>position (size too) from the pigment statement for a y plane like
>>>yours. The default is for z plane instead, with the lower left corner
>>>being at <0,0,0> then up and right one unit to <1,1,0>.
>>
>>Thank you. Now it works fine.. I've just overviewed this 90 degree turn
>>of my plane.
>>
>>I can finish my macro now...

> 	I find this to be more generally useful. 
8< 8< 8< 8< 8< 8<

Thanks but the other hint was quite enough. I was just wondering why my 
texture did not appear. I placed it on my container anyway, so I do not 
need to make it waving ^^;

Sincerely,
Maik Schmidt


Post a reply to this message

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