POV-Ray : Newsgroups : povray.newusers : Put a text label on two sides of a non-planar object Server Time: 19 Dec 2018 13:15:18 GMT
  Put a text label on two sides of a non-planar object (Message 1 to 5 of 5)  
From: Franz von Dardel
Subject: Put a text label on two sides of a non-planar object
Date: 11 May 2017 15:20:00
Message: <web.59147fd7804715f36826427b0@news.povray.org>
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?


Post a reply to this message

From: clipka
Subject: Re: Put a text label on two sides of a non-planar object
Date: 11 May 2017 16: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

From: Franz von Dardel
Subject: Re: Put a text label on two sides of a non-planar object
Date: 11 May 2017 20:20:01
Message: <web.5914c5fb89c421df6826427b0@news.povray.org>
Many thanks, clipka,

I eventually found the solution, as you described, in a 2010 post by Friedrich
Lohmüller:
http://www.f-lohmueller.de/pov_tut/tex/tex_875d.htm

I split the hull of the ship by a clipped_by command, and applied the label
separately on both halves.

Thanks again


Post a reply to this message

From: Kenneth
Subject: Re: Put a text label on two sides of a non-planar object
Date: 12 May 2017 12:50:01
Message: <web.5915ae6189c421df883fb31c0@news.povray.org>
>
> How can I put the same label on both sides of the object?

There's another way to do this, using POV-Ray's 'boxed' pattern, to restrict an
image-map's 'spatial volume' when applied to an object. (A typical image_map
projection extends to infinity, which is why it is also showing up on the other
side of your ship object, while appearing reversed there).

Take a look at this newsgroup post (hopefully, the URL below will appear
correctly on your system)

http://news.povray.org/povray.binaries.images/message/%3Cweb.4bb4bd96b883f0ef65f302820%40news.povray.org%3E/#%3Cweb.4bb
4bd96b883f0ef65f302820%40news.povray.org%3E


Post a reply to this message

From: Kenneth
Subject: Re: Put a text label on two sides of a non-planar object
Date: 12 May 2017 13:10:00
Message: <web.5915b2f589c421df883fb31c0@news.povray.org>
Sorry; this is the full post...

http://news.povray.org/povray.binaries.images/thread/%3Cweb.4bb4bd96b883f0ef65f302820%40news.povray.org%3E/


Post a reply to this message

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