POV-Ray : Newsgroups : povray.newusers : Put a text label on two sides of a non-planar object : Re: Put a text label on two sides of a non-planar object Server Time
19 Apr 2024 09:32:18 EDT (-0400)
  Re: Put a text label on two sides of a non-planar object  
From: clipka
Date: 11 May 2017 12:34:18
Message: <5914928a$1@news.povray.org>
Am 11.05.2017 um 17:14 schrieb Franz von Dardel:
> My object is a prism (cubic_spline). I cannot use a text object, because the
> place where I want to put the label is not planar. So I have tried to use a
> layered texture with an image_map (containing my text) on top.
> It looks fine on one side (say South) of the object:
> http://dardel.info/imagesPOV/Navire4a.png
> but on the other side (say North) it appears reversed:
> http://dardel.info/imagesPOV/Navire4b.png.
> 
> How can I put the same label on both sides of the object?

You would need a compound texture that divides 3D space along the
centerline of the hull. For example you could use a scaled-up `checker`
pattern, like so:

    // your label texture
    #local LabelTx = texture { ... } // first layer
                     texture { ... } // 2nd layer

    // the compound texture
    // (this presumes that y is up, z is along the centerline
    // of the ship, the ship is no more than 1000
    // units long, and the label is centered at z=0)
    #local HullTx = texture {
      checker
      texture {
        LabelTx
        scale 1/1000 translate -z*0.5
      }
      texture {
        LabelTx rotoate <0,180,0>
        scale 1/1000 translate -z*0.5
      }
      translate z*0.5
      scale 1000
    }

Note the scaling-down and translating of both label texture instances to
counteract the translating and scaling-up of the checker pattern.

Also note the rotation of the label texture in the 2nd instance to
mirror the text; `scale <1,1,-1>` would also be a viable alternative.


Post a reply to this message

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