POV-Ray : Newsgroups : povray.newusers : Simple 2D text on a cylinder's surface Server Time
24 Nov 2024 17:47:24 EST (-0500)
  Simple 2D text on a cylinder's surface (Message 1 to 10 of 23)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Marty Schrader
Subject: Simple 2D text on a cylinder's surface
Date: 11 Oct 2007 21:46:51
Message: <470ed20b$1@news.povray.org>
This subject has been beaten to death on this group, but to no satisfactory 
conclusion.

How does one go about laying 2D text -- like a label or a painted stencil -- on 
to the surface of a cylinder? This seems to be a pretty common problem for us 
noobs. Nobody has come up with a straightforward answer yet.

Please include some POV example source. Additionally, if you refer to some POV 
term such as "object pattern" please include a reference number for the help 
facility. I have searched for "object pattern" all over the help and can't find 
this term used anywhere.

A general description of the technique used to solve problems doesn't help us 
newbies very much. It is particularly unhelpful to say something like "start by 
looking at the documentation for XYZ keyword and work from there." Look, if you 
guys know this stuff then please help the noobular get going with specifics.

POV is a pretty intimidating renderer, with more power than you can shake a 
memory stick at. It's very hard for somebody to get a project going when the 
rendered image is only a small part of the overall project results, so we can't 
dedicate eight work hours a day researching this stuff. Once the newb gets past 
the Big Hurdle then the rest of it seems to come a lot quicker. Eh?


Post a reply to this message

From: Samuel Benge
Subject: Re: Simple 2D text on a cylinder's surface
Date: 12 Oct 2007 02:39:40
Message: <470f16ac$1@news.povray.org>
Marty Schrader wrote:
> This subject has been beaten to death on this group, but to no 
> satisfactory conclusion.

Here you go, Marty:

// begin code
#declare my_text=
text{
  ttf"arialbd.ttf"
  "Hello World!"
  10,0
  translate<0,-0.25,0>
}

cylinder{<0,-1,0>,<0,1,0>,1
  pigment{
   pigment_pattern{
    object{my_text 0,1}
    scale<0.1,1,1>
    warp{cylindrical}
    rotate y*180
   }
   pigment_map{
    [0 granite]
    [1 rgb 1]
   }
  }
}
// end code

I'm sure you can figure out the specifics of the my_text object for 
yourself.

The two numbers after my_text (inside the object{} block) are the colors 
for the background and foreground, respectively. The object pigment is 
scaled and a cylindrical warp is applied to it which essentially wraps 
it around the cylinder. To insure the granite pigment does not warp with 
the text, the object pigment is encased within a pigment_pattern block. 
This resets all the transformations outside the pigment_pattern block 
(including warps) and allows you to use a pigment_map with the object 
pigment. You can nest as many pigment_pattern blocks as you wish.

For more information, look these topics up:
  3.4.11.23  Object Pattern
  3.4.1.2  Color List Pigments
  3.4.1.4  Pigment Maps and Pigment Lists
  3.4.12.6.5  Mapping using warps
  3.4.11.25  Pigment Pattern
  3.3.1.13  Text


Post a reply to this message

From: Warp
Subject: Re: Simple 2D text on a cylinder's surface
Date: 12 Oct 2007 07:05:20
Message: <470f54f0@news.povray.org>
Marty Schrader <mar### [at] parsecsystemsinccom> wrote:
> How does one go about laying 2D text -- like a label or a painted stencil -- on 
> to the surface of a cylinder?

  Here's a solution:
http://tag.povray.org/povQandT/languageQandT.html#cylindricalrepeat

-- 
                                                          - Warp


Post a reply to this message

From: Marty Schrader
Subject: Re: Simple 2D text on a cylinder's surface
Date: 13 Oct 2007 16:00:55
Message: <471123f7$1@news.povray.org>
Thanks for getting back to me with a complete answer. The immediate things I 
notice are these:

POV has no mechanism for painting 2D text on to a surface. There are all kinza 
ways to paint patterns and pre-made images on to surfaces, but no way to lay 
down simple 2D text. This seems like a major flaw to me.

There is a very limited set of string manipulation and calculation functions 
available withing POV script. For instance, the book mentions strlen in talking 
about other string functions, but strlen itself isn't available. This would be 
very helpful in figuring out how to position text without a lot of trial and 
error. Heavy accent on the error.

The book references you gave me don't point to anything. My POV for Windows 
(3.6.1) help file goes up to 3.4.9, but you mention sections 3.4.11 and 12. The 
online help is even worse, since Chapter 3 is the reference in the help file, 
but it's about windows in the online docs.

How do I find more info?


Post a reply to this message

From: Warp
Subject: Re: Simple 2D text on a cylinder's surface
Date: 13 Oct 2007 16:16:52
Message: <471127b3@news.povray.org>
Marty Schrader <mar### [at] parsecsystemsinccom> wrote:
> POV has no mechanism for painting 2D text on to a surface. There are all kinza 
> ways to paint patterns and pre-made images on to surfaces, but no way to lay 
> down simple 2D text. This seems like a major flaw to me.

  Can you give us an example of some pattern which you can apply to a
surface in a way that you cannot apply a text pattern in the same way?

> There is a very limited set of string manipulation and calculation functions 
> available withing POV script. For instance, the book mentions strlen in talking 
> about other string functions, but strlen itself isn't available. This would be 
> very helpful in figuring out how to position text without a lot of trial and 
> error. Heavy accent on the error.

  Functions are classified by their return value type, not by the parameter
type. strlen() is in the float functions section because it returns a float.

-- 
                                                          - Warp


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Simple 2D text on a cylinder's surface
Date: 13 Oct 2007 17:06:48
Message: <47113368$1@news.povray.org>
Marty Schrader wrote:
> The book references you gave me don't point to anything. My POV for
> Windows (3.6.1) help file goes up to 3.4.9, but you mention sections
> 3.4.11 and 12. The online help is even worse, since Chapter 3 is the
> reference in the help file, but it's about windows in the online docs.

The first number denotes a "book" not a "chapter". Since there are three
platform specific "books", but the online help cannot have three "books"
with the same number (yet it makes the most sense to have platform docs
first), the order is different, the actual chapter numbers are identical though.

	Thorsten, POV-Team


Post a reply to this message

From: M a r c
Subject: Re: Simple 2D text on a cylinder's surface
Date: 13 Oct 2007 19:30:40
Message: <47115520$1@news.povray.org>

47113368$1@news.povray.org...
> Marty Schrader wrote:
>> The book references you gave me don't point to anything. My POV for
>> Windows (3.6.1) help file goes up to 3.4.9, but you mention sections
>> 3.4.11 and 12. The online help is even worse, since Chapter 3 is the
>> reference in the help file, but it's about windows in the online docs.
>
> The first number denotes a "book" not a "chapter". Since there are three
> platform specific "books", but the online help cannot have three "books"
> with the same number (yet it makes the most sense to have platform docs
> first), the order is different, the actual chapter numbers are identical 
> though.
>
> Thorsten, POV-Team

I wonder how many dried frog pills were swallowed to keep that cool ;-)

Marc


Post a reply to this message

From: Marty Schrader
Subject: Re: Simple 2D text on a cylinder's surface
Date: 13 Oct 2007 19:52:15
Message: <47115a2f$1@news.povray.org>
Thanks for the heads up on strlen().

A "text pattern"? Okay, see, this is the part that kills me. What I wish to do 
is paint some simple, flat, non-complex text on to the surface of some object. 
This would seem to be a fairly common operation and one which would seem to call 
for its own painting mechanism. I see quite a few requests for help on this 
subject here on this group and in some of the other POV groups.

What you are telling me is that I need to create a complex 3D object and 
manipulate it all over the place in order to paint 2D text. I gotta take a 3D 
object and slice it off with an implied intersection to make a 2D pattern, which 
I can then use to...Oy!

Not only that, but my experiments so far indicate that the positioning of the 
text on the cylinder's surface will be a matter of much hassle and fudging. 
Apparently there is no other way. Perhaps it would be smarter to create text as 
an external graphic and lay that down with one of the other methods.

By the way, strlen() returns a float? I have only been doing this C stuff for 25 
years or so, but a float?!? And in the last 32 years I can't recall coming 
across any language spec where the builtins were index by their return type as 
opposed to the operational group to which they belonged. String length is 
related to strings. And the length should be a character count instead of some 
graphic index, eh? Perhaps a different name, like <float> StringGraphicLength() 
or something.

Thanks for all the help, guys. I think I am at an impasse here. Gonna hafta use 
a JPEG image for my text. Easier.


Post a reply to this message

From: Marty Schrader
Subject: Re: Simple 2D text on a cylinder's surface
Date: 13 Oct 2007 19:56:07
Message: <47115b17$1@news.povray.org>
Heh, heh. It's amazing that somebody can apologize for how screwed up something 
is and still make it sound as if it's your fault for not reading the FAQ or 
whatever. Hey, I'm not gonna whine too loudly. As long as I can find the data 
I'm golden.


Post a reply to this message

From: Tim Attwood
Subject: Re: Simple 2D text on a cylinder's surface
Date: 13 Oct 2007 21:17:47
Message: <47116e3b$1@news.povray.org>
> What you are telling me is that I need to create a complex 3D object and 
> manipulate it all over the place in order to paint 2D text. I gotta take a 
> 3D object and slice it off with an implied intersection to make a 2D 
> pattern, which I can then use to...Oy!

The typical method that I use for this sort of thing is to use image_maps.
It seems perty straight-forward to me, I wouldn't say that lack of a text
pattern makes much difference, either way you'll end up having to scale
the resulting words pigment to look right.

The text object, and the object pattern are handy in some cases,
but they are not replacements for layered textures.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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