POV-Ray : Newsgroups : povray.newusers : Texture Server Time
1 Nov 2024 19:15:10 EDT (-0400)
  Texture (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: Daniel
Subject: Texture
Date: 10 Feb 2005 18:15:05
Message: <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!


Post a reply to this message

From: Marc Jacquier
Subject: Re: Texture
Date: 12 Feb 2005 04:05:51
Message: <420dc6ef@news.povray.org>

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

From: Daniel
Subject: Re: Texture
Date: 12 Feb 2005 08:59:16
Message: <420e0bb4$1@news.povray.org>
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] wanadoofr> wrote in message 
news:420dc6ef@news.povray.org...
>

> 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

From: Bob Hughes
Subject: Re: Texture
Date: 12 Feb 2005 19:37:31
Message: <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

From: Daniel
Subject: Re: Texture
Date: 14 Feb 2005 19:06:05
Message: <42113ced$1@news.povray.org>
Can you make this thick and only on one side of the box?
"Bob Hughes" <omn### [at] charternet> 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

From: Bob Hughes
Subject: Re: Texture
Date: 15 Feb 2005 00:31:22
Message: <4211892a$1@news.povray.org>
"Daniel" <new### [at] hotmailcom> 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

From: Mike Williams
Subject: Re: Texture
Date: 15 Feb 2005 00:47:43
Message: <9jrcnHAD9UECFw2c@econym.demon.co.uk>
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

From: Bob Hughes
Subject: Re: Texture
Date: 15 Feb 2005 00:54:48
Message: <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

From: Daniel
Subject: Re: Texture
Date: 15 Feb 2005 19:13:27
Message: <42129027$1@news.povray.org>
Can some1 please make me a sample?  I'm very new at POV ray.
"Bob Hughes" <omn### [at] charternet> 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

From: Bob Hughes
Subject: Re: Texture
Date: 15 Feb 2005 23:08:54
Message: <4212c756$1@news.povray.org>
"Daniel" <new### [at] hotmailcom> 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

Goto Latest 10 Messages Next 7 Messages >>>

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