POV-Ray : Newsgroups : povray.advanced-users : image_map problem :( Server Time
26 Nov 2024 11:19:15 EST (-0500)
  image_map problem :( (Message 1 to 4 of 4)  
From: ?
Subject: image_map problem :(
Date: 19 May 2000 09:20:16
Message: <39253F8A.E878A83A@ardess.org>
Hello Guys,

I am currently trying to use Pov to make a virtual box, My troube comes
with the "image_map" functionality .
I'd like to map some GIF's on each face of that box, it works very fine
with the cover and the back of the object, but when I try to apply it
on the sides, the top and the bottom, It fails each time, I mean POV
tries to map the GIF's but it only takes a bit of it so Only a little
part of the GIF is displayed on the box, II defined my SCALE and
TRANSLATE in the same state of mind as for the cover and the back, but i
don't know why it does NOT work :(
Well, PLEASE, HAVE A LOOK AT MY SCRIPT BELOW, THANKS A LOT, I've been
reading the  the Manual for a bunch of days, I tried to find some
examples on the web, everything seems allright, but I am still at the
same situation.

I thought that you guys maybe encoutered that kinda trouble and prolly
know how to fix it,

Regards,

Here is a copy of my POV SOURCE :
:)
--------------------------------

#version 3.0
#include "colors.inc"
#include "textures.inc"

global_settings { assumed_gamma 2.2 }

camera {
   location  <80, 70,100>
   direction <0, 0,  -3.6>
   up        <0, 1,  0>
   right   <4/3, 0,  0>
   look_at   <0, 3, 0>
}

box {    <0,0,0>,      < 0,30,1>  pigment { White} }
box {    <0,0,0>,      < 60,0,1>  pigment { Green} }
box {    <0,0,0>,      < 0,1,60>  pigment { White} }


light_source {
<0, 0,100>
color White
shadowless
}

light_source {
<0, 0,-100>
color White
shadowless
}

light_source {
<0, 0,100>
color White
shadowless
}

light_source {
<100, 0,0>
color White
shadowless
}

light_source {
<100,180,0>
color White
shadowless
}

sky_sphere { pigment { White} }

union {

//THIS IS THE BOTTOM OF THE BOX
box {    <2,0,0>,      < 22,0,3.3>
   pigment {Yellow}  }   // socle
box {    <2, 24, 3.3>,      < 22,0,3.3>
   texture {

//THIS IS THE FACE OF THE BOX <--- This One WORKS FINE
pigment {
image_map {gif "../face.gif" }
scale <20,24,1> translate <2,0,2>
     } // fin pigment
} // fin texture


}

//THIS IS THE RIGHT SIDE OF THE BOX  <--- Can't display the whole image,
only a bit is scaled
box {    <22,0,3.3>,      < 22,24,0>
 texture {
pigment {
image_map {gif "../cotedroit.gif" }
scale <22,24,-3.3> translate <20,0,1>
     } // pigment 's end
}
} // cote droit



//THIS IS THE LEFT SIDE OF THE BOX
box {    <2,0,0>,      <22,0,3.3 >
   pigment {Green}  }   // cote gauche


// THIS IS THE TOP OF THE BOX  <--- Can't display the whole image, only
a bit is scaled
box {    <2,24,3.3>,      < 22,24,0>
   pigment {
image_map {gif "../boite_haut.gif" }
scale <2,24,3.3> translate <0, 0, 1>
}}  // top


box {    <2,0,0>,      < 22,24,0>
   texture {
   pigment {
   image_map {gif "../boite_dos.gif" } <--- This one WORKS FINE
   scale <-20,24,0> translate <2,0,0>
     } //  pigment 's end
}  }  // Bottom


// rotate <300 ,-80 ,0>
//  rotate <0 ,180 ,0>
}


Post a reply to this message

From: Mike Weber
Subject: Re: image_map problem :(
Date: 19 May 2000 10:14:07
Message: <39254c2f$1@news.povray.org>
image_maps work in the XY plane.  You need to create a box{<-1,-1,0><1,1,1>}
use the image_map then rotate the box into the correct position.


"?" <noe### [at] ardessorg> wrote in message
news:39253F8A.E878A83A@ardess.org...
> Hello Guys,
>
> I am currently trying to use Pov to make a virtual box, My troube comes
> with the "image_map" functionality .
> I'd like to map some GIF's on each face of that box, it works very fine
> with the cover and the back of the object, but when I try to apply it
> on the sides, the top and the bottom, It fails each time, I mean POV
> tries to map the GIF's but it only takes a bit of it so Only a little
> part of the GIF is displayed on the box, II defined my SCALE and
> TRANSLATE in the same state of mind as for the cover and the back, but i
> don't know why it does NOT work :(


Post a reply to this message

From: C J 
Subject: Re: image_map problem :(
Date: 19 May 2000 12:32:37
Message: <39256ca5@news.povray.org>
There is a Image Map tutorial on my site in the Basic POV section.

www.crosswinds.net/~povstudy
C.J. - POV User


Post a reply to this message

From: Margus Ramst
Subject: Re: image_map problem :(
Date: 19 May 2000 13:36:40
Message: <39256DD3.1B8C1453@peak.edu.ee>
? wrote:
> 
> Hello Guys,
> 
> I am currently trying to use Pov to make a virtual box, My troube comes
> with the "image_map" functionality .

A planar image_map is by default projected on the XY plane, going from x=0; y=0
to x=1; y=1
In order to apply it to a surface facing up or to the side, you have rotate it
accordingly (or create the object along the XY plane, apply the texture and then
rotate the object in place).
Here's a skeleton example; I'll use polygons for the faces of the box:

#declare Tex=
texture{image_map... translate <-0.5,-0.5,0> scale 2}
//The transformation is there to align the image with the face

#declare Face=
polygon{4, <-1,-1,-1>, <-1,1,-1>, <1,1,-1>, <1,-1,-1>}

union{
  object{Face texture{Tex}}
  object{Face texture{Tex} rotate y*90}
  object{Face texture{Tex} rotate y*-90}
  object{Face texture{Tex} rotate x*90}
  object{Face texture{Tex} rotate x*-90}
  object{Face texture{Tex} rotate x*180}
}

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

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