POV-Ray : Newsgroups : povray.newusers : Problems with image_map Server Time
25 Dec 2024 01:16:39 EST (-0500)
  Problems with image_map (Message 1 to 3 of 3)  
From: Nils Bronstert
Subject: Problems with image_map
Date: 2 Nov 2002 07:38:11
Message: <mck0qa.pja.ln@520075573253-0001.dialin.t-online.de>
Hello,

I have some questions about using image-maps in POV-Ray. There seem to
be a lot of restrictions using them, so I'm not sure how to do some
things I want to do.

The first problem is: I have some objects and I want to apply an
image_map to them. For example I have a box in my scene-file and I want
to use an image_map on all sides except the top and the bottom. I've
done the following:

#declare Picture = texture {pigment {image_map {png "picture.png"
                                             interpolate 2
                                             once}}
                         finish {ambient 0.2}
                         scale 4-Epsilon
                         translate <-2+Epsilon/2, 0, -2+Epsilon/2>}

box {<-2, 0, -2>, <2, 4, 2>
     texture {pigment {color White}
              finish {ambient 0.2}}
     texture {Picture}
     rotate y*90
     texture {Picture}
     rotate y*90
     texture {Picture}
     rotate y*90
     texture {Picture}
     rotate y*90}

This doesn't work the way I expected. It seems that the logo.png is
punched through the cube, so that on the other side of the cube it
appears mirrored.
My question is: How do I put an image_map on all sides of the cube?
Do I have to make the box out of two objects or is there an easyer
solution? The problem gets even worse, because I have a prism-object
with six sides where I want to have an image on each side.

The second question is: Why can't I apply an image_map to a CSG-object?
Is there a solution for this problem?

And finally the third question: Is it possible to wrap an image_map
with "map_type 2" around a box? If yes, then how does the image have to
look? May I use an image that contains 4 images - one for every side of
the box like this?

-----------------
|   |   |   |   |
|   |   |   |   |
-----------------

Regards
-- 
Nils Bronstert                            /// C= Amiga PPC 604e 266 MHz
mailto:bro### [at] fh-wormsde                ///           68060 50 MHz
In a world without walls and fences, \\\///            Amiga OS/Linux
nobody needs Windows and Gates!       \XX/


Post a reply to this message

From: Christoph Hormann
Subject: Re: Problems with image_map
Date: 2 Nov 2002 08:32:23
Message: <3DC3D3E6.D9AFE740@gmx.de>
Nils Bronstert wrote:
> 
> The first problem is: I have some objects and I want to apply an
> image_map to them. For example I have a box in my scene-file and I want
> to use an image_map on all sides except the top and the bottom. I've
> done the following:
> 
> [...]

I suggest you read up the doc parts about textures and image maps.  There
is no point in having multiple texture statements in an object (apart from
layered textures of course but that would require transparency).  What you
seemingly want is a patterned texture.

> My question is: How do I put an image_map on all sides of the cube?
> Do I have to make the box out of two objects or is there an easyer
> solution? The problem gets even worse, because I have a prism-object
> with six sides where I want to have an image on each side.

You should have a look at the UV mapping feature.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 28 Oct. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Nils Bronstert
Subject: Re: Problems with image_map
Date: 3 Nov 2002 10:18:32
Message: <04i3qa.63e.ln@520075573253-0001.dialin.t-online.de>
* Christoph Hormann <chr### [at] gmxde>:
> Nils Bronstert wrote:
> > 
> > The first problem is: I have some objects and I want to apply an
> > image_map to them. For example I have a box in my scene-file and I want
> > to use an image_map on all sides except the top and the bottom. I've
> > done the following:
> > 
> > [...]
> 
> I suggest you read up the doc parts about textures and image maps.  There
> is no point in having multiple texture statements in an object (apart from
> layered textures of course but that would require transparency).  What you
> seemingly want is a patterned texture.

No, there *is* a point in having multiple texture statements in an
object, even if there is no transparency. There *is* a difference
between this

box {<-2, 0, -2>, <2, 4, 2>
     texture {pigment {color White}
              finish {ambient 0.2}}
     texture {Picture}}

and this example

box {<-2, 0, -2>, <2, 4, 2>
     texture {Picture}}

even if the "Picture"-texture has *no transparency* applied (as in my
texture-example). The texture "Picture" in my example was *smaller* than
the box and I had the "once"-option turned on, because I wanted the box
to appear white at the regions of the box which are not covered by the
picture. So the effect I wanted worked, but it didn't work to apply the
picture to all four sides of the box and not just two sides (for example
the front and left side). I can apply the image_map to the front and to
the left. It is then punched through the box to the back and to the
right where it appears mirrored of course. Now if I try to apply
image_maps to the right or to the back the other image_maps get
overwritten (which is the logical consequence of the concept of a
"punched-through" texture).

It seems that there is no way (at least not in POV-Ray 3.1g) to apply
one or multiple image_maps on different sides of one primitive. It seems
that I have to use two objects to form a box to be able to apply the
texture to all four sides of a box. But perhaps there is a trick,
because it gets very complicated with prism-shapes?

> > My question is: How do I put an image_map on all sides of the cube?
> > Do I have to make the box out of two objects or is there an easyer
> > solution? The problem gets even worse, because I have a prism-object
> > with six sides where I want to have an image on each side.
> 
> You should have a look at the UV mapping feature.

Is that a new feature of POV-Ray 3.5? I'm using POV-Ray 3.1g but I'll
try the new version.

Is it possible to apply an image_map to a CSG-object by using this UV
mapping?

Regards
-- 
Nils Bronstert                            /// C= Amiga PPC 604e 266 MHz
mailto:bro### [at] fh-wormsde                ///           68060 50 MHz
In a world without walls and fences, \\\///            Amiga OS/Linux
nobody needs Windows and Gates!       \XX/


Post a reply to this message

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