POV-Ray : Newsgroups : povray.general : problem with image transformation... Server Time
5 Nov 2024 16:41:06 EST (-0500)
  problem with image transformation... (Message 1 to 4 of 4)  
From: AJ
Subject: problem with image transformation...
Date: 8 Jan 2005 02:25:00
Message: <web.41df8992b1bdc25cda5747b10@news.povray.org>
hi!
i draw a cylinder with an image of me wrapped around it (multiple instances
of the image) like followed. but the image is drawn 2 times correctly an
the other times it i look cone-headed or completly misty (especially on the
top of the sylinder). what options could i use that there are multiple
images on the cylinder and each looks clearly?

thx for an answer

#include "colors.inc"
camera {
        location <-4,4,-4 >
 look_at  <0,0,0>
}

light_source {
  <-10, 18, -5>            // light's position (translated below)
  color White  // light's color
}
cylinder {
   <0,0,0>,
   <2,0,0>,
   2
 pigment {
 image_map {jpeg "C:ProgrammePOV-Ray for Windows v3.6pic.jpg" }
 }
}


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: problem with image transformation...
Date: 8 Jan 2005 04:28:24
Message: <41dfa7b8@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

AJ wrote:
| hi!
| i draw a cylinder with an image of me wrapped around it (multiple
instances
| of the image) like followed. but the image is drawn 2 times
correctly an
| the other times it i look cone-headed or completly misty
(especially on the
| top of the sylinder). what options could i use that there are multiple
| images on the cylinder and each looks clearly?
|
	You want  to look at the map_type keyword. By default your image is
mapped to a plane which doesn't work too well in your case :) but you
can change that to a sphere, a cylinder or a torus (or u/v
coordinates). I don't remember what number is which though so you'll
have to rtfm for that part.

		Jerome
- --
******************************
*      Jerome M. Berger      *
* mailto:jbe### [at] ifrancecom *
*  http://jeberger.free.fr/  *
******************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFB36e3qIYJdJhyixIRAjD5AKCK5Z9ufRJUnGaA0hrZ/IyiT6oh/QCfSVlZ
wrJnEWKesFcAU9sa2pPLBdI=
=7zCn
-----END PGP SIGNATURE-----


Post a reply to this message

From: Mike Williams
Subject: Re: problem with image transformation...
Date: 8 Jan 2005 06:12:09
Message: <+sXskAA9$73BFwTq@econym.demon.co.uk>

>Hash: SHA1
>
>AJ wrote:
>| hi!
>| i draw a cylinder with an image of me wrapped around it (multiple
>instances
>| of the image) like followed. but the image is drawn 2 times
>correctly an
>| the other times it i look cone-headed or completly misty
>(especially on the
>| top of the sylinder). what options could i use that there are multiple
>| images on the cylinder and each looks clearly?
>|
>       You want  to look at the map_type keyword. By default your image is
>mapped to a plane which doesn't work too well in your case :) but you
>can change that to a sphere, a cylinder or a torus (or u/v
>coordinates). I don't remember what number is which though so you'll
>have to rtfm for that part.

But if you use map_type 2, you only ever get one copy of the image
wrapped round the cylinder. Using scaling or frequency doesn't let you
get multiple copies of the image wrapped round the cylinder.

I suspect that it might be possible to use three pigment functions, one
for each colour channel, perform scaled cylindrical polar
transformations on them and combine the three results back together.
There was a thread somewhere a while ago about how to combine pigment
function channels which I didn't take note of.

A uv_mapped Surface of Revolution does support multiple image_mapped
images, so you can do this:

#include "colors.inc"
camera {
        location <-4,4,-4 >
 look_at  <0,0,0>
}

light_source {
  <-10, 18, -5>
  color White
}

sor {4,
    <2, -2>
    <2, -1>
    <2, 1>
    <2, 2>
    uv_mapping
    pigment {
      image_map {jpeg "C:ProgrammePOV-Ray for Windows v3.6pic.jpg" }
      scale <0.1,1,1>
    }
  rotate z*90    
}


Or, if you don't want the end caps painted like that:

#include "colors.inc"
camera {
        location <-4,4,-4 >
 look_at  <0,0,0>
}

light_source {
  <-10, 18, -5>
  color White
}

intersection {
 box {<-1,-2,-2><1,2,2> pigment {rgb 1}}
 sor {4,
    <2, -2>
    <2, -1.1>
    <2, 1.1>
    <2, 2>
    uv_mapping
    pigment {
      image_map {jpeg "C:ProgrammePOV-Ray for Windows v3.6pic.jpg" }
      scale <0.1,1,1>
    }
  rotate z*90    
 }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: problem with image transformation...
Date: 8 Jan 2005 10:02:14
Message: <41dff5f6$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mike Williams wrote:
| But if you use map_type 2, you only ever get one copy of the image
| wrapped round the cylinder. Using scaling or frequency doesn't let you
| get multiple copies of the image wrapped round the cylinder.
|
	You're right, if you want to have several copies of the image, you
need to use planar mapping, scale your image by 1/number on the y
axis and apply a cylindrical warp with an orientation of x.

	Untested sample code:

#include "colors.inc"
camera {
~        location <-4,4,-4 >
~ look_at  <0,0,0>
}

light_source {
~  <-10, 18, -5>            // light's position (translated below)
~  color White  // light's color
}
cylinder {
~   <0,0,0>,
~   <2,0,0>,
~   2
~   pigment {
~     image_map {jpeg "C:\ProgrammePOV-Ray for Windows v3.6\pic.jpg" }
~     scale <1, 1/7, 1>
~     warp { cylindrical orientation y }
~   }
}

		Jerome
- --
******************************
*      Jerome M. Berger      *
* mailto:jbe### [at] ifrancecom *
*  http://jeberger.free.fr/  *
******************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFB3/X2qIYJdJhyixIRAnd5AJ0UZs0z1CDQO6L58DR5jsVd7OJ7GQCfW7uW
UeeX/88s9Cn8DyJs+K3vHDw=
=k4U4
-----END PGP SIGNATURE-----


Post a reply to this message

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