POV-Ray : Newsgroups : povray.newusers : Mobius and image_map Server Time
22 Dec 2024 11:37:11 EST (-0500)
  Mobius and image_map (Message 1 to 2 of 2)  
From: Trips
Subject: Mobius and image_map
Date: 1 Feb 2012 20:45:01
Message: <web.4f29e9a0bb41d3278c0eec1e0@news.povray.org>
I want to render a mobius in Povray that has a surface texture that is a "decal"
of an image (the image is a long strip and should appear in the rendered output
as if the strip had been pressed onto the mobius).

I tried all of the map_type's defined in the documentation, but in all cases the
projection is highly distorted.

If you create an 800x100 pixel white image with a blue circle in the middle for
"surface.png", you'll see what I mean.

How can I correct the projection?

Here's the .pov file:

    //---------------------------------
    #declare P_R=0.2; #declare P_H=0.75;
    #declare Profile =
    union{
     sphere  {<0, P_H,0>,P_R}
     cylinder{<0,-P_H,0>,<0,P_H,0>,P_R}
     sphere  {<0,-P_H,0>,P_R }
    texture
       {
            pigment
            {
                image_map
                {
                    png "surface.png"
                    map_type 0
                    interpolate 2
                }
                scale <0.20,0.2,0.2>
            }
            finish {ambient 0.85
                 diffuse 0.55

                 phong 1}
        }
    }
    //----------------------------------
    #declare Radius_major = 3.00;
    #declare N_major =  0.5;
    #declare N_minor = 2000;
    //----------------------------------
    #declare Nr =0;              //start
    #declare EndNr=N_major*N_minor;//end
    #while (Nr< EndNr)
    object{Profile
           rotate<0,0,Nr * 360/N_minor>
           translate<Radius_major,0,0>
           rotate<0,Nr * 360/EndNr,0>}
     #declare Nr = Nr+1;// next Nr_minor
    #end // ------------ end of loop --
    camera {
       location <-5, 10, -15>
       direction <0, 0,  2.25>
       right x*1.33
       look_at <0,0,0>
    }


Post a reply to this message

From: Le Forgeron
Subject: Re: Mobius and image_map
Date: 2 Feb 2012 03:06:03
Message: <4f2a43eb@news.povray.org>
Le 02/02/2012 02:40, Trips a écrit :
> I tried all of the map_type's defined in the documentation, but in all cases the
> projection is highly distorted.
> 
> If you create an 800x100 pixel white image with a blue circle in the middle for
> "surface.png", you'll see what I mean.
> 
> How can I correct the projection?

You are using a projection with an object (y along cylinder with
spherical caps) that goes through the origin.

As the projection is centred at the origin, it is normal that you get a
distortion. (excepted for type 0: planar projection)

Move your projection (translate the pigment, or translate the object,
apply pigment, and translate back the whole thing) and may be also check
the projection direction: map_type 0 is a plane in x-y, does it match
your expectation ?

Also, you repeat your textured object to generate your strip, which
might have a side effect on final aspect.

You should try to tune with a "once" in the mapping.

-- 
A good Manager will take you
through the forest, no mater what.
A Leader will take time to climb on a
Tree and say 'This is the wrong forest'.


Post a reply to this message

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