 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I'm wondering how to import alpha images as a texture and made the opaque
colors a side of a box object. Please contact me!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Daniel" <new### [at] hotmail com> a écrit dans le message de
news:420beaf9$1@news.povray.org...
> I'm wondering how to import alpha images as a texture and made the opaque
> colors a side of a box object. Please contact me!
>
>
I'm not sure I get fully what you mean by "made the opaque colors a side of
a box object."
Marc
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I mean like a cookie cutter effect with the transparent parts. So if its
fully transparent it would cut out the other parts.
"Marc Jacquier" <jac### [at] wanadoo fr> wrote in message
news:420dc6ef@news.povray.org...
>
> "Daniel" <new### [at] hotmail com> a écrit dans le message de
> news:420beaf9$1@news.povray.org...
>> I'm wondering how to import alpha images as a texture and made the opaque
>> colors a side of a box object. Please contact me!
>>
>>
> I'm not sure I get fully what you mean by "made the opaque colors a side
> of
> a box object."
>
> Marc
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Well, there's nothing to importing them. Simply use an image file that has
the alpha channel and apply it to the box, as in:
box {
0,1
pigment {
image_map {
png "alpha.png"
} // will be centered on both +z and -z faces
}
}
Where "alpha" is the files name, and png the file type. I think only PNG and
TGA are accepted, but I'm not completely sure of that. I had to look this up
in the documentation myself, been a while since I used it. Have a look under
section 3.5.1.5 Image Map which has a subsection 3.5.1.5.3 Using the Alpha
Channel
I read this before Marc replied but I was a little confused by the question,
too, perhaps thinking it more complicated than really is.
Bob Hughes
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Can you make this thick and only on one side of the box?
"Bob Hughes" <omn### [at] charter net> wrote in message
news:420ea14b$1@news.povray.org...
> Well, there's nothing to importing them. Simply use an image file that has
> the alpha channel and apply it to the box, as in:
>
> box {
> 0,1
> pigment {
> image_map {
> png "alpha.png"
> } // will be centered on both +z and -z faces
> }
> }
>
> Where "alpha" is the files name, and png the file type. I think only PNG
> and TGA are accepted, but I'm not completely sure of that. I had to look
> this up in the documentation myself, been a while since I used it. Have a
> look under section 3.5.1.5 Image Map which has a subsection 3.5.1.5.3
> Using the Alpha Channel
>
> I read this before Marc replied but I was a little confused by the
> question, too, perhaps thinking it more complicated than really is.
>
> Bob Hughes
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Daniel" <new### [at] hotmail com> wrote in message
news:42113ced$1@news.povray.org...
> Can you make this thick and only on one side of the box?
Getting it to be only one side is easily done, but if you're wanting the
part that shows on that boxes surface to have a certain thickness- well,
that'll need a surface to exist where there isn't one. The problem being
that all POV objects are inherently empty unless interacting with another
surface. Image maps don't create a surface.
What might do okay is 'media', which can use the image as a density pattern.
That way you'd be using two boxes, one inside the other, with the media
contained only between the walls.
I'd have to try making an example to show how that works all together, so
if I can I'll post it here later if I come up with something. Unless of
course you already get the idea.
If there's another way I'm not thinking of it right now.
Bob Hughes
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Wasn't it Daniel who wrote:
>Can you make this thick and only on one side of the box?
I think you need to use a heightfield rather than a texture.
The image (cookiecutter.png" in the code below) should be the cutout
shape. This can either be a completely white image with an alpha channel
indicating the cutouts, or an image without an alpha channel which uses
black for the holes and white for the solid parts.
If you also want an image-based texture, you'll need a second image
without an alpha channel ("texture.png" in the code below).
#version 3.6;
global_settings {assumed_gamma 1.0}
camera {location <-10,10,-10> look_at <0,0,0> angle 15}
background {rgb 1}
light_source {<-30, 100, -50> color rgb 1}
#declare Thickness = 0.04;
#declare W=1-Thickness;
// The lid has a cut out
intersection {
height_field {png "cookiecutter.png"
translate <-0.5,0,-0.5>
scale <2,1,2>
}
box {<-0.99,W,-0.99><0.99,1,0.99>}
pigment {image_map {png "texture.png"}
rotate x*90
translate <-0.5,0,-0.5>
scale 2
}
}
// The other sides don't
difference {
box {-0.99,0.99}
box {<-W,-W,-W><W,1.1,W>}
pigment {rgb 1}
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Sorry. I see Mike Williams has answered better anyhow and I didn't see his
reply before. I almost suggested HF.
I mistakenly thought it would be simple to use an image file for media
density and yet it's relegated to needing to be in df3 format applied via
'density_file'. My lack of using POV-Ray lately is making it difficult to
discuss the program anymore! But I'll get by okay. ;^)
Bob Hughes
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Can some1 please make me a sample? I'm very new at POV ray.
"Bob Hughes" <omn### [at] charter net> wrote in message
news:42118ea8$1@news.povray.org...
> Sorry. I see Mike Williams has answered better anyhow and I didn't see his
> reply before. I almost suggested HF.
>
> I mistakenly thought it would be simple to use an image file for media
> density and yet it's relegated to needing to be in df3 format applied via
> 'density_file'. My lack of using POV-Ray lately is making it difficult to
> discuss the program anymore! But I'll get by okay. ;^)
>
> Bob Hughes
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Daniel" <new### [at] hotmail com> wrote in message
news:42129027$1@news.povray.org...
> Can some1 please make me a sample? I'm very new at POV ray.
Since you're new to this I sure hope you can figure out what I've done here:
// BEGIN HERE
global_settings {
assumed_gamma 1
}
camera {location -3*z up y right image_width/image_height*x look_at 0}
light_source {<100,100,-100>,1}
#declare ImagePart=
texture {
pigment {
image_map {
png "alpha.png"
}
}
}
#declare InvisiblePart=
texture {
pigment {
rgbt 1
}
}
// thick-walled box
intersection {
height_field {
png "alpha.png"
water_level 0.005 // remove lowest/darkest part
// some adjustments to get into place
rotate -90*x
scale <1.001,1.001,2>
translate 0.5*z
}
difference {
box {
0,1 // outside
}
box {
0.1,0.9 // inside
}
}
texture {
gradient z
texture_map {
[0.1 ImagePart] // trying to match thickness surface...
[0.1 InvisiblePart] // ... so are transformations below
}
scale <1.02,1.02,2> // some adjustments to get into place...
translate <-0.01,-0.01,-0.01> // ... so that coverage is good
}
translate <-0.5,-0.5,-0.5> // center on world origin
rotate <0,-45,0> // turn to show thickness better
}
// show where box is
difference {
box {
0,1 // outside edges
}
box {
0.01,0.99 // cutaway sides
scale <1.1,1,1> translate -0.015*x
}
box {
0.01,0.99 // cutaway top/bottom
scale <1,1.1,1> translate -0.015*y
}
box {
0.01,0.99 // cutaway front/back
scale <1,1,1.1> translate -0.015*z
}
pigment {
color rgb 1
}
translate <-0.5,-0.5,-0.5> // center on world origin
rotate <0,-45,0> // turn to show thickness better
}
// END HERE
No doubt this complicated to go through just for a simple thing such as this
but I'm not able to think of a better way. Obviously there's a whole lot of
juggling the positions around to fit it all together right, and I suppose
you'll be changing it to do what you want.
Maybe this will help anyhow. You can always ask more questions.
Bob Hughes
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Props to you. I basically understand it. I learn by taking source code of
programs apart and trying various things. So thanks again! If you want to
see my finished logo for proposal, I'll be happy to send it to you. Now its
off to combining the alphabet blocks (or my own) to this. Should look
prerty convincing.
"Bob Hughes" <omn### [at] charter net> wrote in message
news:4212c756$1@news.povray.org...
> "Daniel" <new### [at] hotmail com> wrote in message
> news:42129027$1@news.povray.org...
>> Can some1 please make me a sample? I'm very new at POV ray.
>
> Since you're new to this I sure hope you can figure out what I've done
> here:
>
> // BEGIN HERE
> global_settings {
> assumed_gamma 1
> }
>
> camera {location -3*z up y right image_width/image_height*x look_at 0}
>
> light_source {<100,100,-100>,1}
>
> #declare ImagePart=
> texture {
> pigment {
> image_map {
> png "alpha.png"
> }
> }
> }
>
> #declare InvisiblePart=
> texture {
> pigment {
> rgbt 1
> }
> }
>
> // thick-walled box
> intersection {
> height_field {
> png "alpha.png"
> water_level 0.005 // remove lowest/darkest part
> // some adjustments to get into place
> rotate -90*x
> scale <1.001,1.001,2>
> translate 0.5*z
> }
> difference {
> box {
> 0,1 // outside
> }
> box {
> 0.1,0.9 // inside
> }
> }
> texture {
> gradient z
> texture_map {
> [0.1 ImagePart] // trying to match thickness surface...
> [0.1 InvisiblePart] // ... so are transformations below
> }
> scale <1.02,1.02,2> // some adjustments to get into place...
> translate <-0.01,-0.01,-0.01> // ... so that coverage is good
> }
> translate <-0.5,-0.5,-0.5> // center on world origin
> rotate <0,-45,0> // turn to show thickness better
> }
>
> // show where box is
> difference {
> box {
> 0,1 // outside edges
> }
> box {
> 0.01,0.99 // cutaway sides
> scale <1.1,1,1> translate -0.015*x
> }
> box {
> 0.01,0.99 // cutaway top/bottom
> scale <1,1.1,1> translate -0.015*y
> }
> box {
> 0.01,0.99 // cutaway front/back
> scale <1,1,1.1> translate -0.015*z
> }
> pigment {
> color rgb 1
> }
> translate <-0.5,-0.5,-0.5> // center on world origin
> rotate <0,-45,0> // turn to show thickness better
> }
> // END HERE
>
> No doubt this complicated to go through just for a simple thing such as
> this but I'm not able to think of a better way. Obviously there's a whole
> lot of juggling the positions around to fit it all together right, and I
> suppose you'll be changing it to do what you want.
>
> Maybe this will help anyhow. You can always ask more questions.
>
> Bob Hughes
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
BTW is there a way to interpolate in the alpha area to make it a solid
object?
"Daniel" <new### [at] hotmail com> wrote in message
news:42136175$1@news.povray.org...
> Props to you. I basically understand it. I learn by taking source code
> of programs apart and trying various things. So thanks again! If you
> want to see my finished logo for proposal, I'll be happy to send it to
> you. Now its off to combining the alphabet blocks (or my own) to this.
> Should look prerty convincing.
> "Bob Hughes" <omn### [at] charter net> wrote in message
> news:4212c756$1@news.povray.org...
>> "Daniel" <new### [at] hotmail com> wrote in message
>> news:42129027$1@news.povray.org...
>>> Can some1 please make me a sample? I'm very new at POV ray.
>>
>> Since you're new to this I sure hope you can figure out what I've done
>> here:
>>
>> // BEGIN HERE
>> global_settings {
>> assumed_gamma 1
>> }
>>
>> camera {location -3*z up y right image_width/image_height*x look_at 0}
>>
>> light_source {<100,100,-100>,1}
>>
>> #declare ImagePart=
>> texture {
>> pigment {
>> image_map {
>> png "alpha.png"
>> }
>> }
>> }
>>
>> #declare InvisiblePart=
>> texture {
>> pigment {
>> rgbt 1
>> }
>> }
>>
>> // thick-walled box
>> intersection {
>> height_field {
>> png "alpha.png"
>> water_level 0.005 // remove lowest/darkest part
>> // some adjustments to get into place
>> rotate -90*x
>> scale <1.001,1.001,2>
>> translate 0.5*z
>> }
>> difference {
>> box {
>> 0,1 // outside
>> }
>> box {
>> 0.1,0.9 // inside
>> }
>> }
>> texture {
>> gradient z
>> texture_map {
>> [0.1 ImagePart] // trying to match thickness surface...
>> [0.1 InvisiblePart] // ... so are transformations below
>> }
>> scale <1.02,1.02,2> // some adjustments to get into place...
>> translate <-0.01,-0.01,-0.01> // ... so that coverage is good
>> }
>> translate <-0.5,-0.5,-0.5> // center on world origin
>> rotate <0,-45,0> // turn to show thickness better
>> }
>>
>> // show where box is
>> difference {
>> box {
>> 0,1 // outside edges
>> }
>> box {
>> 0.01,0.99 // cutaway sides
>> scale <1.1,1,1> translate -0.015*x
>> }
>> box {
>> 0.01,0.99 // cutaway top/bottom
>> scale <1,1.1,1> translate -0.015*y
>> }
>> box {
>> 0.01,0.99 // cutaway front/back
>> scale <1,1,1.1> translate -0.015*z
>> }
>> pigment {
>> color rgb 1
>> }
>> translate <-0.5,-0.5,-0.5> // center on world origin
>> rotate <0,-45,0> // turn to show thickness better
>> }
>> // END HERE
>>
>> No doubt this complicated to go through just for a simple thing such as
>> this but I'm not able to think of a better way. Obviously there's a whole
>> lot of juggling the positions around to fit it all together right, and I
>> suppose you'll be changing it to do what you want.
>>
>> Maybe this will help anyhow. You can always ask more questions.
>>
>> Bob Hughes
>>
>>
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Okay. Good that you think it'll work for you. I thought afterward that I
should maybe have said something about the "alpha.png" being used for both
height_field and pigment, along the lines of: it might not do well to use
the same exact image file because of the HF using a specific color=height
thing. Probably not always going to work right. And water_level I gave it
would drop any dark parts- including those that are in your logo/symbol.
Best thing would be a cutout kind of image so whole thing is just black and
white, that way you have a reasonably good edge for the graphic your trying
to create the extrusion for.
Not always easy to convey every detail for a new POV-Ray user. Good to read
the documentation for what you find in the scripts, in order to get the
details figured out or move on to the next question.
Oh yeah, and thanks for the offer to see the result but no need to do that.
Unless you want to post at povray.binaries.images, of course.
Bob Hughes
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Could I email you a pix of what i got so far. There are some bugs that you
may know how to fix. Thanks!
"Bob Hughes" <omn### [at] charter net> wrote in message
news:4213aaa2@news.povray.org...
> Okay. Good that you think it'll work for you. I thought afterward that I
> should maybe have said something about the "alpha.png" being used for both
> height_field and pigment, along the lines of: it might not do well to use
> the same exact image file because of the HF using a specific color=height
> thing. Probably not always going to work right. And water_level I gave it
> would drop any dark parts- including those that are in your logo/symbol.
> Best thing would be a cutout kind of image so whole thing is just black
> and white, that way you have a reasonably good edge for the graphic your
> trying to create the extrusion for.
>
> Not always easy to convey every detail for a new POV-Ray user. Good to
> read the documentation for what you find in the scripts, in order to get
> the details figured out or move on to the next question.
>
> Oh yeah, and thanks for the offer to see the result but no need to do
> that. Unless you want to post at povray.binaries.images, of course.
>
> Bob Hughes
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
It looks fuzzy if you know what I mean. When I have the block set to
intersection, and the block becomes fuzzy when it is white or on another
Pigment.
"Daniel" <new### [at] hotmail com> wrote in message
news:4213b44b$1@news.povray.org...
> Could I email you a pix of what i got so far. There are some bugs that
> you may know how to fix. Thanks!
> "Bob Hughes" <omn### [at] charter net> wrote in message
> news:4213aaa2@news.povray.org...
>> Okay. Good that you think it'll work for you. I thought afterward that I
>> should maybe have said something about the "alpha.png" being used for
>> both height_field and pigment, along the lines of: it might not do well
>> to use the same exact image file because of the HF using a specific
>> color=height thing. Probably not always going to work right. And
>> water_level I gave it would drop any dark parts- including those that are
>> in your logo/symbol. Best thing would be a cutout kind of image so whole
>> thing is just black and white, that way you have a reasonably good edge
>> for the graphic your trying to create the extrusion for.
>>
>> Not always easy to convey every detail for a new POV-Ray user. Good to
>> read the documentation for what you find in the scripts, in order to get
>> the details figured out or move on to the next question.
>>
>> Oh yeah, and thanks for the offer to see the result but no need to do
>> that. Unless you want to post at povray.binaries.images, of course.
>>
>> Bob Hughes
>>
>>
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Daniel" <new### [at] hotmail com> wrote in message
news:4213a911$1@news.povray.org...
> BTW is there a way to interpolate in the alpha area to make it a solid
> object?
Missed you asking this by only minutes, apparently.
I don't think I know what you're actually asking. If I understand you right
all you're wanting to do is keep that face of the box intact instead of just
leaving the logo image floating in midair. If so, the water_level amount I
mentioned before will allow that to happen if you change it to 0 or no
keyword and number at all, as long as the surrounding image color is only
solid black. However, your original question seemed to indicate you wanted
it as a cutout having nothing surrounding it, hence the alpha channel for
transparency.
Sorry, I forgot about the way it also intersects with the thick-walled box
object. You'd need to keep the HF from getting snipped off by rescaling it
to be shallower and/or move it outward (-z*?) some. Or even making the box
solid itself first by removing the differenced inner box.
Only other thing I can guess you might have meant is, if the edge of the HF
image can be smoother than it is now. I can only suggest adding the keyword
'smooth' into the HF (before or after water_level) or increase your logo
image resolution.
Otherwise, please elaborate on the question, if you can.
Bob Hughes
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Daniel" <new### [at] hotmail com> wrote in message
news:4213b44b$1@news.povray.org...
> Could I email you a pix of what i got so far. There are some bugs that
> you may know how to fix. Thanks!
Sure thing. Could be the only way to ever know what is being described
anyway.
Bob Hughes
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |