POV-Ray : Newsgroups : povray.newusers : patterns + White, Black, alpha Server Time
21 Dec 2024 12:55:46 EST (-0500)
  patterns + White, Black, alpha (Message 1 to 5 of 5)  
From: Bald Eagle
Subject: patterns + White, Black, alpha
Date: 5 Sep 2014 20:55:01
Message: <web.540a5b4f68b280f25e7df57c0@news.povray.org>
I'm trying to muddle through the process of using an image file to create a
3D-ish looking ornate picture frame.

I kinda 'get' that I'll probably have to nest 1 or 2 of these
image/pigment/pattern/map(s) together in order to get this to work, but I'm
getting all twisted up.
I finally figured out how to FILL the border and center of the frame with a
transparent color in Paint.Net, so I have a frame composed of white, black, and
the transparent parts that I don't wish to be visible when rendered.

I haven't done much with these commands, but I've seen that folks reference
their use a lot, so they seem like a powerful tool.

Can someone give me a clue?

height_field {png "Frame2.png" smooth
 translate<-0.5,-0.0,-0.5>
 scale <946, 15, 799>/5
 rotate -x*90

texture {
  image_pattern { png "Frame2.png" once}
  texture_map {
    [0 MyGold]
    [1 pigment { transmit 1 } ]
    }
 }
}


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: patterns + White, Black, alpha
Date: 6 Sep 2014 05:08:38
Message: <540acf16$1@news.povray.org>

> I'm trying to muddle through the process of using an image file to create a
> 3D-ish looking ornate picture frame.
>
> I kinda 'get' that I'll probably have to nest 1 or 2 of these
> image/pigment/pattern/map(s) together in order to get this to work, but I'm
> getting all twisted up.
> I finally figured out how to FILL the border and center of the frame with a
> transparent color in Paint.Net, so I have a frame composed of white, black, and
> the transparent parts that I don't wish to be visible when rendered.
>
> I haven't done much with these commands, but I've seen that folks reference
> their use a lot, so they seem like a powerful tool.
>
> Can someone give me a clue?
>
> height_field {png "Frame2.png" smooth
>   translate<-0.5,-0.0,-0.5>
>   scale <946, 15, 799>/5
>   rotate -x*90
>
> texture {
>    image_pattern { png "Frame2.png" once}
>    texture_map {
>      [0 MyGold]
>      [1 pigment { transmit 1 } ]
>      }
>   }
> }
>
>

   Well... you really didn't need alpha for this: the height_field 
object has a "water_level" statement wich allows you to cut the 
undesired parts. This way you don't need to use a texture map, just a 
regular texture. For this to work, just paint the border and center with 
total black, and the desired frame with a grayscale above black, then 
use "water_level 0.01" or so (might need some trial&error to find the 
best level).

height_field {png "Frame2.png" smooth
   water_level 0.01
   texture {MyGold}
   translate<-0.5,-0.0,-0.5>
   scale <640, 15, 400>/5
   rotate -x*90
}


   Anyhow, on the example you posted, I guess you are missing some 
transformations on the texture: if you want it to align with the object. 
My prefered way would be:

height_field {png "Frame2.png" smooth
  texture {
    image_pattern { png "Frame2.png" once}
    texture_map {
      [0 MyGold]
      [1 pigment { transmit 1 } ]
      }
    rotate 90*x
   }
   translate<-0.5,-0.0,-0.5>
   scale <946, 15, 799>/5
   rotate -x*90
}

   Also, I guess you may want to reverse the texture map entries and 
adjust the transition...

   Regards,

--
jaime


Post a reply to this message

From: Bald Eagle
Subject: Re: patterns + White, Black, alpha
Date: 6 Sep 2014 11:25:00
Message: <web.540b26487c0a49655e7df57c0@news.povray.org>
Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:
>    Well... you really didn't need alpha for this:

I always have to add my trademark "unnecessary level of added complexity" to my
first go at things.  :)

> the height_field
> object has a "water_level" statement wich allows you to cut the
> undesired parts.

Argh.  I was starting to look at that and consider it, but it was after a long
day of puzzling out other things.   That's obvious now - thanks!

> This way you don't need to use a texture map, just a
> regular texture. For this to work, just paint the border and center with
> total black, and the desired frame with a grayscale above black,
.....
>    Also, I guess you may want to reverse the texture map entries and
> adjust the transition...

I see.  This works well now.


Thank you for your expert assistance - I'm always amazed at your raytracings.
You have a real knack for composition, details, texturing and lighting that
always knocks my socks off.   Thanks for all of your inspirational images over
the years!

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

I have a few more questions related to this topic.
Because of the way POV-Ray maps the image to the primitive, it needs to be
scaled to something proportional to the image's original aspect ratio.  Is there
a way to pull this value from the file with POV-Ray?  I'm assuming the
information is readily available, since Windows displays it when I mouse-over
the filename, and POV-Ray has to be able to determine this to correctly read the
file format.

This would be super handy for evaluating a lot of different images, especially
with an array of filenames and invoking POV-Ray's animation features.

Suppose I DID use the alpha channel.
Is there a way to use that for a second texture, so that I can use water-level
to get rid of the perimeter, and put the second texture inside the frame?

Thanks for your prompt reply!
(I had a late night, so I'm just resuming work on this now.)


Post a reply to this message

From: Alain
Subject: Re: patterns + White, Black, alpha
Date: 6 Sep 2014 14:50:37
Message: <540b577d@news.povray.org>

> Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:
>>     Well... you really didn't need alpha for this:
>
> I always have to add my trademark "unnecessary level of added complexity" to my
> first go at things.  :)
>
>> the height_field
>> object has a "water_level" statement wich allows you to cut the
>> undesired parts.
>
> Argh.  I was starting to look at that and consider it, but it was after a long
> day of puzzling out other things.   That's obvious now - thanks!
>
>> This way you don't need to use a texture map, just a
>> regular texture. For this to work, just paint the border and center with
>> total black, and the desired frame with a grayscale above black,
> .....
>>     Also, I guess you may want to reverse the texture map entries and
>> adjust the transition...
>
> I see.  This works well now.
>
>
> Thank you for your expert assistance - I'm always amazed at your raytracings.
> You have a real knack for composition, details, texturing and lighting that
> always knocks my socks off.   Thanks for all of your inspirational images over
> the years!
>
> -----------------------
>
> I have a few more questions related to this topic.
> Because of the way POV-Ray maps the image to the primitive, it needs to be
> scaled to something proportional to the image's original aspect ratio.  Is there
> a way to pull this value from the file with POV-Ray?  I'm assuming the
> information is readily available, since Windows displays it when I mouse-over
> the filename, and POV-Ray has to be able to determine this to correctly read the
> file format.
>
> This would be super handy for evaluating a lot of different images, especially
> with an array of filenames and invoking POV-Ray's animation features.
>
> Suppose I DID use the alpha channel.
> Is there a way to use that for a second texture, so that I can use water-level
> to get rid of the perimeter, and put the second texture inside the frame?
>
> Thanks for your prompt reply!
> (I had a late night, so I'm just resuming work on this now.)
>
>

You may try max_extent(Your_Image)
As of version 3.7, it's suposed to return the dimentions of an image 
when the provided object is an image.


Alain


Post a reply to this message

From: Bald Eagle
Subject: Re: patterns + White, Black, alpha
Date: 6 Sep 2014 15:50:01
Message: <web.540b64e97c0a49655e7df57c0@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> You may try max_extent(Your_Image)
> As of version 3.7, it's suposed to return the dimentions of an image
> when the provided object is an image.


It's supposed to, and it DOES!
The documentation even provides immediately useful SDL example code. /HAPPY/
Thank you Alain, that's exactly what I was looking for.
As always, you are an endless font of information.  :)


Post a reply to this message

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