POV-Ray : Newsgroups : povray.newusers : Making a pigment or texture directly from text {} Server Time
23 Feb 2025 18:41:58 EST (-0500)
  Making a pigment or texture directly from text {} (Message 1 to 7 of 7)  
From: Bald Eagle
Subject: Making a pigment or texture directly from text {}
Date: 22 Feb 2025 13:25:00
Message: <web.67ba163b10362e541f9dae3025979125@news.povray.org>
Is there a way to do this?

object texture?
function?
Some way to internally generate an image_map?

Seems like it ought to be possible, but I'm not seeing the path to a solution.

- BE


Post a reply to this message

From: Leroy
Subject: Re: Making a pigment or texture directly from text {}
Date: 22 Feb 2025 16:00:00
Message: <web.67ba39f568c695a193103de1f712fc00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Is there a way to do this?
>
> object texture?
> function?
> Some way to internally generate an image_map?
>
> Seems like it ought to be possible, but I'm not seeing the path to a solution.
>
> - BE

If I understand you right you want to turn a text object into a pigment or
texture

Using the 'object' pattern should do the trick.


Post a reply to this message

From: Bald Eagle
Subject: Re: Making a pigment or texture directly from text {}
Date: 22 Feb 2025 17:10:00
Message: <web.67ba4a8d68c695a11f9dae3025979125@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > Is there a way to do this?
> >
> > object texture?
> > function?
> > Some way to internally generate an image_map?
> >
> > Seems like it ought to be possible, but I'm not seeing the path to a solution.
> >
> > - BE
>
> If I understand you right you want to turn a text object into a pigment or
> texture
>
> Using the 'object' pattern should do the trick.

Hmm.  Yes.
However, that doesn't function like an image_map - it's a volumetric
inside/outside test on 3D text.
I can of course import that into a function and use a pigment {function {F(x, y,
0)}} to extend that infinitely in the z direction, but if I want color, then I
have to resort to making an average {} texture . . . and that starts to get
involved and messy.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Making a pigment or texture directly from text {}
Date: 23 Feb 2025 05:13:18
Message: <67baf4be@news.povray.org>
On 22/02/2025 23:07, Bald Eagle wrote:
> "Leroy" <whe### [at] gmailcom> wrote:
>> "Bald Eagle" <cre### [at] netscapenet> wrote:
>>> Is there a way to do this?
>>>
>>> object texture?
>>> function?
>>> Some way to internally generate an image_map?
>>>
>>> Seems like it ought to be possible, but I'm not seeing the path to a solution.
>>>
>>> - BE
>>
>> If I understand you right you want to turn a text object into a pigment or
>> texture
>>
>> Using the 'object' pattern should do the trick.
> 
> Hmm.  Yes.
> However, that doesn't function like an image_map - it's a volumetric
> inside/outside test on 3D text.
> I can of course import that into a function and use a pigment {function {F(x, y,
> 0)}} to extend that infinitely in the z direction, but if I want color, then I
> have to resort to making an average {} texture . . . and that starts to get
> involved and messy.
> 


Not sure if I'm really answering your question, but yes, texture { 
pigment { object { text { ... should meet your needs.

I pulled out an old test scene with this :

// ---------------------------------------------------------------------

union {
cone { <0, 0, 0>, Rad, <0, 0, -0.50>, Rad-0.50 }
cylinder { <0, 0, 0>, <0, 0, Len>, Rad }
cone { <0, 0, Len>, Rad, <0, 0, Len+0.50>, Rad-0.50 }

texture {
pigment {
object {
#declare Texte = text {
ttf FontName Str 1, <0, 0, 0>
scale FontScale
rotate -90*y
}
#declare TexteMax = max_extent(Texte);
#declare TexteMin = min_extent(Texte);
#declare Translation = 0.50*<2*Rad, 
TexteMin.y-((TexteMax.y-TexteMin.y)*0.50), Len-TexteMax.z>;
text {
ttf  FontName  Str 1, <0, 0, 0>
scale FontScale
rotate -90*y
translate Translation
} // end of text
pigment { color White*0.25 }
pigment { color Orange*1.15 }
} // end of object
//			turbulence <0.10, 0.20, 0.05>
} // end of pigment


finish { phong 0.90 phong_size 8 }
// normal { cells bump_size 0.15 no_bump_scale scale 0.50 turbulence 0.15 }
} // end of texture
} // end of union


// ---------------------------------------------------------------------


that give the image



-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message


Attachments:
Download 'pigment_object.jpg' (69 KB)

Preview of image 'pigment_object.jpg'
pigment_object.jpg


 

From: Kenneth
Subject: Re: Making a pigment or texture directly from text {}
Date: 23 Feb 2025 05:50:00
Message: <web.67bafbd968c695a1e83955656e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Leroy" <whe### [at] gmailcom> wrote:
> >
> > Using the 'object' pattern should do the trick.
>
> Hmm.  Yes.
> However, that doesn't function like an image_map -
> it's a volumetric inside/outside test on 3D text.
> I can of course import that into a function and use a pigment {function {F(x, y,
> 0)}} to extend that infinitely in the z direction, but if I want color, then I
> have to resort to making an average {} texture . . . and that starts to get
> involved and messy.

I take it that you mean averaging three weighted color functions to get full
color. Yeah, it's involved.

I do sense your desire to somehow create an actual pigment pattern from text, to
be used like any other POV-ray pattern. I wouldn't know how to do that-- but as
a practical matter, it seems to me that Leroy's object pattern idea would
fulfill the goal, simply by scaling it VERY large in z. 'Infinitely' long, so to
speak. And the result can use actual colors.

I have attached a test scene; that's the first example.

My 2nd example is more involved, and makes use of a 'function image'-- which
produces an image_map of the text object. By nature, it is 'infinitely long' in
z, just like any other simple image_map application. But it has a problem, due
to one of the various function uses (probably the OBJ_PATT_TO_FUNC): The result
is strictly grayscale. I've tried different ways of adding colors at various
places, but they all fail. Even adding an inline color_map after

   image_map{
        function 600,600 {OBJ_PATT_TO_FUNC(x,y,z).green}

doesn't work like it usually does for averaged color functions, fatal error.
Maybe there is *some* other way of adding colors that I don't yet grasp.

Anyway, if you feel like experimenting, have fun with the code.


Post a reply to this message


Attachments:
Download 'tester for be text-to-pattern question 2_23_25.pov.txt' (2 KB)

From: William F Pokorny
Subject: Re: Making a pigment or texture directly from text {}
Date: 23 Feb 2025 07:53:17
Message: <67bb1a3d$1@news.povray.org>
On 2/22/25 17:07, Bald Eagle wrote:
> if I want color, then I
> have to resort to making an average {} texture . . . and that starts to get
> involved and messy.

I doubt I completely understand what you want to do.

The yuqk fork has a list_object{} feature like bool_object{} - which in 
POV-Ray proper is called object{}). The list_object would let you define
up to 12 text objects, each supporting a texture (a 13th slot is the 
default texture for 3D points not inside any of the list's text-objects).

I'm not following the image_map part of the discussion. The image based 
/ driven textures / patterns are volumetric too - though in what way 
depends on the map type selected, for example. The object / inside tests
can be infinite in z, for example, by fixing the z coordinate at a value 
within the range of the text object's depth.

Aside: I believe clipka's uberpov had some sort of text page feature, 
though I confess to having never played with it. He posted an example 
image highlighting some SDL IIRC.

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Making a pigment or texture directly from text {}
Date: 23 Feb 2025 09:00:00
Message: <web.67bb28d068c695a11f9dae3025979125@news.povray.org>
Thanks guys,

There's a much easier way to do it, and get full color as well.

repeat warp in z


------------------------------------------------------------------



#version 3.8;
global_settings {assumed_gamma 1.0 }



camera {
 location <0, 2, -10>
 right x*image_width/image_height
 up y
 look_at <0, 0, 0>
}

light_source {<0, 50, -100> rgb 1}
sky_sphere {pigment {rgb 1}}

#declare Text =
union {
 #local Scale = 1/6;
 text { ttf "arial.ttf", "Text Line1", 2, 0.0 translate y*2}
 text { ttf "arial.ttf", "Text Line2", 2, 0.0 translate y*1}
 text { ttf "arial.ttf", "Text Line3", 2, 0.0 }
 translate -z*1
 scale Scale
 translate x*Scale/2
}

#declare HollowP =
pigment {
 object {
  Text
  color rgb x+y   // outside
  color rgb 0    // inside
 }
}

//#declare FHollow = function {pigment {HollowP warp {repeat x*1} warp {repeat
y*0.5}}}
#declare Hollow = pigment {HollowP warp {repeat x*1} warp {repeat y*0.5} warp
{repeat z*0.1}}

#for (X, -10, 10)
 box {0, 1
  translate <X, 0, X*0.5>
  texture {pigment {Hollow}}
 }

#end


Post a reply to this message


Attachments:
Download 'easyinfinitetext.png' (64 KB)

Preview of image 'easyinfinitetext.png'
easyinfinitetext.png


 

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