POV-Ray : Newsgroups : povray.newusers : Making a pigment or texture directly from text {} : Re: Making a pigment or texture directly from text {} Server Time
23 Feb 2025 15:18:59 EST (-0500)
  Re: Making a pigment or texture directly from text {}  
From: kurtz le pirate
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


 

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