POV-Ray : Newsgroups : povray.general : image_map stretched on objects Server Time
6 Nov 2024 12:19:43 EST (-0500)
  image_map stretched on objects (Message 1 to 6 of 6)  
From: Summit Group
Subject: image_map stretched on objects
Date: 15 Jun 2004 15:35:01
Message: <web.40cf4ed955871fcca9326b250@news.povray.org>
I've been trying to apply a fabric image map to a couch that I've been
working on. I created the model in 3D Studio, and I used accutrans3d to
convert it to POV-Ray. From there I added the image map like this:

  texture {
    pigment {
      image_map {jpeg "07-2312-482.jpg" map_type 0}
    }
    finish { ambient rgb<0.466667, 0.541176, 0.678431> diffuse 0.5 }
  }

and this is the result:

http://avis.summit-tech.ca/render/povforum.png

Notice how the image map gets streched as though it was applied head on. The
other problem was finding a way (from povray) to set the sizing of the tile
when it gets applied. Right now I'm forced to resize the object (at the
time of export) in order to obtain the image tile size that I want.

Any help with either of these two issues would be much appreciated.

Thanks,

Ron.


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: image_map stretched on objects
Date: 15 Jun 2004 16:11:23
Message: <40cf57eb@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Summit Group wrote:
| I've been trying to apply a fabric image map to a couch that I've been
| working on. I created the model in 3D Studio, and I used accutrans3d to
| convert it to POV-Ray. From there I added the image map like this:
|
|   texture {
|     pigment {
|       image_map {jpeg "07-2312-482.jpg" map_type 0}
|     }
|     finish { ambient rgb<0.466667, 0.541176, 0.678431> diffuse 0.5 }
|   }
|
| and this is the result:
|
| http://avis.summit-tech.ca/render/povforum.png
|
| Notice how the image map gets streched as though it was applied
head on.
	That's because it was "applied head on". That's what "map_type 0"
means. What you need to do is use UV mapping (provided your model has
UV coordinates of course).

| The
| other problem was finding a way (from povray) to set the sizing of
the tile
| when it gets applied. Right now I'm forced to resize the object (at the
| time of export) in order to obtain the image tile size that I want.
|
	By default, POV puts the image in a 1 by 1 square from 0 to 1 on the
x and y axis (I think, not sure about the axis). You can scale,
translate and rotate the texture to position it as you want
independently of the object you apply it to (just use the
corresponding transform in the texture block). Note that if you use
UV mapping, the texture is naturally at the right position and size
(unless you want the pattern to repeat itself, in which case you will
need to scale it down).

		Jerome

- --
******************************
*      Jerome M. Berger      *
* mailto:jbe### [at] ifrancecom *
*  http://jeberger.free.fr/  *
******************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAz1fmqIYJdJhyixIRAifXAKCUNuwButaDXZBxbUt9pWdAwRTP1wCdEYwW
fQ4KdwXk8eXec8dS/xa6Y/o=
=61lQ
-----END PGP SIGNATURE-----


Post a reply to this message

From: Alain
Subject: Re: image_map stretched on objects
Date: 15 Jun 2004 17:52:38
Message: <40cf6fa6$1@news.povray.org>
Summit Group nous apporta ses lumieres ainsi en ce 15/06/2004 15:32... :

>I've been trying to apply a fabric image map to a couch that I've been
>working on. I created the model in 3D Studio, and I used accutrans3d to
>convert it to POV-Ray. From there I added the image map like this:
>
>  texture {
>    pigment {
>      image_map {jpeg "07-2312-482.jpg" map_type 0}
>    }
>    finish { ambient rgb<0.466667, 0.541176, 0.678431> diffuse 0.5 }
>  }
>
>and this is the result:
>
>http://avis.summit-tech.ca/render/povforum.png
>
>Notice how the image map gets streched as though it was applied head on. The
>  
>
Because it is. Use UV maping to make it follow the surface of the object.

>other problem was finding a way (from povray) to set the sizing of the tile
>when it gets applied. Right now I'm forced to resize the object (at the
>time of export) in order to obtain the image tile size that I want.
>  
>
You can scale the image to your object: image_map {jpeg 
"07-2312-482.jpg" map_type 0 scale<5,5,1>}

>Any help with either of these two issues would be much appreciated.
>
>Thanks,
>
>Ron.
>
>
>  
>
Think of any texture as an infinite solid out of whitch you carve out 
whatever object you apply it to. In the case of an image_map, each image 
pixel stretch out infinitely along the z axis.

Alain


Post a reply to this message

From: Summit Group
Subject: Re: image_map stretched on objects
Date: 15 Jun 2004 20:20:01
Message: <web.40cf913c413fd65ba9326b250@news.povray.org>
Alain <aze### [at] qwertygov> wrote:
> Summit Group nous apporta ses lumieres ainsi en ce 15/06/2004 15:32... :

[stuff deleted]

> >Notice how the image map gets streched as though it was applied head on. The
> >
> Because it is. Use UV maping to make it follow the surface of the object.

Can you include an example of how to do this? Where would I look in the
documentation? I did some more examples, and I can understand the problem.

> You can scale the image to your object: image_map {jpeg
> "07-2312-482.jpg" map_type 0 scale<5,5,1>}

This part worked out great! Thanks to both yourself and Jerome for the help.

> Think of any texture as an infinite solid out of whitch you carve out
> whatever object you apply it to. In the case of an image_map, each image
> pixel stretch out infinitely along the z axis.

That is indeed the case based on the tests that I've done. Here's the
example of a cube that I built to see how I could apply the image map:

#version 3.5;

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

camera {
  location  <3.0, 0.5, -4.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}


sky_sphere {
  pigment {
     gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

plane {
  y, -1
  pigment { color rgb <0.7,0.5,0.3> }
}

box {
  <0,0,0>, <1, 1, 1>
  texture {
    pigment {
      image_map {jpeg "02-7693-211.jpg"}
    }
    finish{
      specular 0.6
    }
  }
}


Ron.


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: image_map stretched on objects
Date: 16 Jun 2004 13:18:11
Message: <40d080d3@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Summit Group wrote:
| Can you include an example of how to do this? Where would I look in the
| documentation? I did some more examples, and I can understand the
problem.
|
	Look here:
http://www.povray.org/documentation/view/3.6.0/73/

		Jerome
- --
******************************
*      Jerome M. Berger      *
* mailto:jbe### [at] ifrancecom *
*  http://jeberger.free.fr/  *
******************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFA0IDSqIYJdJhyixIRAjsKAKCqGAoCv1BVNkMppP+tL8Scft1OnwCgp3Yo
fDsR7qm1Yi5h90nzrbaJhc0=
=JOk/
-----END PGP SIGNATURE-----


Post a reply to this message

From: Summit Group
Subject: Re: image_map stretched on objects
Date: 16 Jun 2004 14:00:01
Message: <web.40d08a20413fd65ba9326b250@news.povray.org>
>  Look here:
> http://www.povray.org/documentation/view/3.6.0/73/

Jerome- Thanks for the link - I found what I needed and I was able to make
it work perfectly!

Ron.


Post a reply to this message

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