POV-Ray : Newsgroups : povray.general : problem with image transformation... : Re: problem with image transformation... Server Time
2 Aug 2024 04:19:48 EDT (-0400)
  Re: problem with image transformation...  
From: Mike Williams
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

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