POV-Ray : Newsgroups : povray.general : How to use an object as the texture? Server Time
22 Dec 2024 23:19:31 EST (-0500)
  How to use an object as the texture? (Message 1 to 4 of 4)  
From: Kima
Subject: How to use an object as the texture?
Date: 19 Feb 2020 20:40:00
Message: <web.5e4de2dc99ee2d4fecc0fada0@news.povray.org>
I started with

#declare t1 = object {
    torus{ 0.5,0.15 scale <1,1,1>
       texture{ pigment{ color rgb<0,1,0>}
                finish { phong 1}
              }
       rotate<90,0,0>
     }
}

lathe{
  cubic_spline 8,
     < 0.00, 0.00>,
     < 0.60, 0.00>,
     < 0.72, 0.44>,
     < 0.31, 0.93>,
     < 0.49, 1.26>,
     < 0.48, 1.35>,
     < 0.43, 1.56>,
     < 0.16, 1.60>
  texture{
    pigment{ color rgb<1,0,0> }
    finish { phong 1}
  }
}

I planned to use the t1 object as a pigment to create a texture_map made of t1
as a pigment + the lathe texture.

However, I was stopped at the first step when I tried to use t1 object as a
pigment:

lathe{
  cubic_spline 8,
     < 0.00, 0.00>,
     < 0.60, 0.00>,
     < 0.72, 0.44>,
     < 0.31, 0.93>,
     < 0.49, 1.26>,
     < 0.48, 1.35>,
     < 0.43, 1.56>,
     < 0.16, 1.60>
  texture{
    pigment{ object { t1 } }
  }
}

The lathe appeared as blue with no sign of t1 object on it. Where does the blue
color come from?

In general, how can I put an object with curvature (here, torus) as the texture
on an object with curvature (here, lathe)?


Post a reply to this message

From: Bald Eagle
Subject: Re: How to use an object as the texture?
Date: 19 Feb 2020 21:00:00
Message: <web.5e4de6fdbe61ecc74eec112d0@news.povray.org>
I can't run through this to what's going on in your code right now, but
hopefully these links will guide you to a swift solution.


http://www.f-lohmueller.de/pov_tut/tex/tex_560e.htm

http://news.povray.org/povray.binaries.images/thread/%3C5da9a3d7%241%40news.povray.org%3E/


Post a reply to this message

From: Kima
Subject: Re: How to use an object as the texture?
Date: 20 Feb 2020 15:50:01
Message: <web.5e4ef060be61ecc7ecc0fada0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I can't run through this to what's going on in your code right now, but
> hopefully these links will guide you to a swift solution.
>
>
> http://www.f-lohmueller.de/pov_tut/tex/tex_560e.htm
>
>
http://news.povray.org/povray.binaries.images/thread/%3C5da9a3d7%241%40news.povray.org%3E/

Thanks for the links. I played with the codes to find a way, and finally ended
up using 'wrap'. Everything seems to work perfectly, but I do not fully
understand where the Object Pattern is fitted on the object. I should ask
another question for this :)


Post a reply to this message

From: Bald Eagle
Subject: Re: How to use an object as the texture?
Date: 20 Feb 2020 16:10:00
Message: <web.5e4ef572be61ecc74eec112d0@news.povray.org>
"Kima" <nomail@nomail> wrote:

> Thanks for the links. I played with the codes to find a way, and finally ended
> up using 'wrap'. Everything seems to work perfectly, but I do not fully
> understand where the Object Pattern is fitted on the object. I should ask
> another question for this :)

In order to understand how patterns work, you need to think in terms of "how
does POV-Ray evaluate what to do with a pixel that represents <x, y, z> in 3D
space.

So when you define a object pattern, you define a 3-dimensional mask, just as if
you had a scene in it with nothing but your transparent object in a big white
empty space.  Now take out a can of spray paint and press down the nozzle.  If
the paint hits your object - right where the bounding box says it is - then it
gets painted.

So the object pattern is sort of set up as pattern (object_paint,
emptySpace_paint)

Maybe that way of thinking about it helps.

If it's still unclear, you can always show your object in the scene with a
regular pigment, maybe with some transparency or filter.  This is useful for
when things like difference {} get confusing.


Post a reply to this message

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