POV-Ray : Newsgroups : povray.general : re-texturing only part of an object? Server Time
1 Aug 2024 12:22:35 EDT (-0400)
  re-texturing only part of an object? (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Roman Reiner
Subject: Re: re-texturing only part of an object?
Date: 28 Dec 2005 07:40:00
Message: <web.43b28677df8284dcded174120@news.povray.org>
i would recommend creating a cutobject (maybe a box or a heightfield) and
slice the textobject in two by using difference and intersection. then you
can easily texture the parts at your will.

Hope this helpes
Regards Roman

"Kenneth" <kdw### [at] earthlinknet> wrote:
> I've made a text object, with a nice translucent "ice" texture. I'd like to
> "paint" the top of the letters white (only the top SURFACES), as a base
> color for tracing on some snow objects. Maybe I'm forgetting something
> basic, but I can't figure out how to do that. Some kind of image_map
> configuration? Procedural texture? Or do I need to use uv-mapping? If
> uv-mapping, can I do it completely within the POV SDL, or do I need an
> external app like UV MAPPER? Though I've been reading up on the subject,
> assume that I don't know very much about how to use the uv-mapping process
> within POV itself.
>
> Thanks in advance for any help!
>
> Ken


Post a reply to this message

From: Roman Reiner
Subject: Re: re-texturing only part of an object?
Date: 28 Dec 2005 07:50:00
Message: <web.43b28909df8284dcded174120@news.povray.org>
After re-reading you post i guess my previously post wasn't the right answer
to your question. i guess the front and backside of the textobject should
stay with the ice texture? then i'd do it that way:
create the textobject with a gradient y texture with your ice and your
snowtexture and transform it that way that the upper half is covered
completely by the snowtexture and the rest by the icetexture. afterwards
intersect it with a box (with the icetexture) that is bigger in y and x
direction but smaller in z direction (assuming that the text goes from -x
to x with y upwards).
That should lead to your wanted object i guess.

Regards Roman


Post a reply to this message

From: Jim Charter
Subject: Re: re-texturing only part of an object?
Date: 28 Dec 2005 11:07:14
Message: <43b2b832$1@news.povray.org>
//Here is two ideas that could be refined:

#local  P =
text {
   ttf
   "courbd.ttf",
   "P",
   2,
   0
};

intersection {

         object {
                 P
                 texture { pigment { White } }

         }
         object {
                 P
                 texture { pigment { Red } }
                 translate <.001,.001,.001>
         }
}

//or:

#local Mx = max_extent ( P );
#local Mn = min_extent ( P );

intersection {

         object {
                 P
                 texture { pigment { Red } }

         }
         box {
               Mn,
               <Mx.x,Mx.y-.001,Mx.z>
               texture { pigment { White } }
         }
         translate x*1
}


Post a reply to this message

From: gonzo
Subject: Re: re-texturing only part of an object?
Date: 28 Dec 2005 17:05:02
Message: <web.43b30b32df8284dca0c272b50@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> I've made a text object, with a nice translucent "ice" texture. I'd like to
> "paint" the top of the letters white (only the top SURFACES), as a base
> color for tracing on some snow objects. Maybe I'm forgetting something
> basic, but I can't figure out how to do that. Some kind of image_map
> configuration? Procedural texture? Or do I need to use uv-mapping? If
> uv-mapping, can I do it completely within the POV SDL, or do I need an
> external app like UV MAPPER? Though I've been reading up on the subject,
> assume that I don't know very much about how to use the uv-mapping process
> within POV itself.
>
> Thanks in advance for any help!
>
> Ken

If the top is completely flat then a slope pattern with only a narrow range
at the top should work.  Assuming the Ice & White textures are already
defined...

#declare Text_Texture = texture {
  slope
  texture_map {
    [0.00  Ice_Texture ]
    [0.95  Ice_Texture ]
    [0.95  White_Texture ]
    [1.00  White_Texture ]
  }
}


Post a reply to this message

From: Kenneth
Subject: Re: re-texturing only part of an object?
Date: 29 Dec 2005 17:05:00
Message: <web.43b45d3ddf8284dc7d28b4e70@news.povray.org>
"gonzo" <rgo### [at] lansetcom> wrote:

>
> If the top is completely flat then a slope pattern with only a narrow range
> at the top should work.  Assuming the Ice & White textures are already
> defined...
>

Unfortunately for me, the lettering has those sloping 45-angles. (Or am I
not reading your reply the right way?)

I see that this is not as straightforward a problem as I thought. Considered
a "difference" with another object (or objects), and may yet go that way.
But I'll definitely try out all the techniques that have been suggested,
and post my results. Thanks to all!

Ken


Post a reply to this message

From: gonzo
Subject: Re: re-texturing only part of an object?
Date: 2 Jan 2006 00:18:51
Message: <43b8b7bb@news.povray.org>
Kenneth wrote:
> "gonzo" <rgo### [at] lansetcom> wrote:
> 
> 
>>If the top is completely flat then a slope pattern with only a narrow range
>>at the top should work.  Assuming the Ice & White textures are already
>>defined...
>>
> 
> 
> Unfortunately for me, the lettering has those sloping 45-angles. (Or am I
> not reading your reply the right way?)

If I'm understanding what you're trying to do, 45 degree angles 
shouldn't be a problem... you have letters that are flat on top with 45 
degree sloping sides?

I see I forgot in my example to provide slope with direction vector 
though, so it should give an error as is...

If y is up in your scene, just 'slope y' should do it.

RG


Post a reply to this message

From: Charles C
Subject: Re: re-texturing only part of an object?
Date: 2 Jan 2006 21:00:01
Message: <web.43b9da64df8284dc58035aeb0@news.povray.org>
When I read your post I assumed by "tracing on some snow objects" you meant
using trace to find the top surface of the letters and cover it in some
kind of fluffy looking snow flakes.  If that's the case, you could always
shoot it with a grid of "trace" and create a form fitting mesh.  Might be a
bit brute force, but hey....

Charles C

Or..... I haven't thought this out yet, but you could do some difference CSG
with some fancy scaling of individual letters.

Or.... Maybe just translate the letters down some tiny amount to make your
cutting object.  Then manuallly add some boxes to the cutting object to get
the bits that remain.


Post a reply to this message

From: Kenneth
Subject: Re: re-texturing only part of an object?
Date: 11 Jan 2006 02:00:05
Message: <web.43c4ab9edf8284dce06d11910@news.povray.org>
"Charles C" <nomail@nomail> wrote:
> When I read your post I assumed by "tracing on some snow objects" you meant
> using trace to find the top surface of the letters and cover it in some
> kind of fluffy looking snow flakes.

yes yes.

> If that's the case, you could always
> shoot it with a grid of "trace" and create a form fitting mesh.  Might be a
> bit brute force, but hey....

Not familiar with that technique, or what it would end up looking like.
Would very much like to know how that's done! As-is, the traced snowflake
blobs look...decent...though not great. Still experimenting with specular
and roughness settings, to get that "snow glint." Even came up with a
somewhat simple "snow layering" trick to build up random thickness ( by
tracing on one layer of union-ed snow objects--then union-ing that WITH the
letters--then going back and tracing another layer onto that combo,
union-ing it all again, etc.) A faster technique than it sounds.


>
> Or.... Maybe just translate the letters down some tiny amount to make your
> cutting object.  Then manuallly add some boxes to the cutting object to get
> the bits that remain.

That's what I ended up doing. Lotsa work, as you can imagine. But made
easier by the flat lettering surfaces.

Actually, I found that with enough snow blobs, the lettering tops didn't
need painting after all!  Go figure...

Ken


Post a reply to this message

From: Kenneth
Subject: Re: re-texturing only part of an object?
Date: 16 Jan 2006 22:15:00
Message: <web.43cc606fdf8284dcdd0484f30@news.povray.org>
"gonzo" <rgo### [at] lansetcom> wrote:

>
> If the top is completely flat then a slope pattern with only a narrow range
> at the top should work.  Assuming the Ice & White textures are already
> defined...

Actually, I've found that the slope pattern does EXACTLY what I wanted! Oh,
I should have tried that first.  :-[   SO much easier than differencing
shapes, etc.

Here's my code for the two textures, one following the other:

// 1st texture, the overall ice...
texture{my_main_ice_texture  etc....}

// 2nd texture...the white fades quickly to transparent as the letters'
// surface normals approach a horizontal direction

texture{
 pigment{
  slope{<0,-1,0>}
  color_map{
    [0.0 rgb 1]
    [0.45 rgb 1]
    [0.55 rgbt 1]
    [1.0 rgbt 1]
    }
 finish{
  ambient 0
  diffuse 1
  }
 }

It's important to set ambient to 0 for this, otherwise its ambient color
will mix with the first texture's color. (Luckily, none of the letter's top
surfaces are in shadow, so ambient 0 is OK.)

The slope pattern doesn't seem to work exactly the way the docs describe it,
though; but that's a question I'll post elsewhere.

I had actually worked with the slope pattern months ago (making a sort of
topogrphic map out of a heightfield, coloring it depending on the surface
normals.)  But just didn't make the mental connection to my letter usage.
Most embarassing.

Thanks for waking up the 'ol brain cells!

Ken


Post a reply to this message

From: Kenneth
Subject: Re: re-texturing only part of an object?
Date: 19 Jan 2006 06:40:00
Message: <web.43cf7978df8284dcdbcfc3c90@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
urfaces are in shadow, so ambient 0 is OK.)
>
> The slope pattern doesn't seem to work exactly the way the docs describe it,
> though; but that's a question I'll post elsewhere.

I posted my question, and some good solutions were offered to my perceived
"problem"...

http://news.povray.org/povray.general/thread/%3Cweb.43cc5cf4e3732dd0484f30%40news.povray.org%3E/

Ken


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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