POV-Ray : Newsgroups : povray.binaries.images : XRay Test Server Time
5 Nov 2024 05:21:56 EST (-0500)
  XRay Test (Message 1 to 10 of 10)  
From: Chris B
Subject: XRay Test
Date: 13 Oct 2009 18:51:47
Message: <4ad50483@news.povray.org>
Render of a skull using the slope pattern:

#declare XRayTexture = texture {
  pigment {
    slope{z}
    pigment_map {
      [0    color rgbt 2*<1,1,1,0.1>]
      [0.75 color rgbt <0.1,0.6,2,1>]
      [1    color rgbt <1,1,1,1>]
    }
  }
  finish {ambient 1}
} 
 
object{
  skull26__null__
  translate 0.1*x 
  texture {XRayTexture}
  no_shadow
}

object{
  skull26__null__ 
  rotate -y*90
  texture {XRayTexture}
  no_shadow
}


Post a reply to this message


Attachments:
Download 'xraytest.jpg' (66 KB)

Preview of image 'xraytest.jpg'
xraytest.jpg


 

From: mone
Subject: Re: XRay Test
Date: 13 Oct 2009 20:20:00
Message: <web.4ad518671466e24f66e6d7c00@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> Render of a skull using the slope pattern:
>
> #declare XRayTexture = texture {
>   pigment {
>     slope{z}
>     pigment_map {
>       [0    color rgbt 2*<1,1,1,0.1>]
>       [0.75 color rgbt <0.1,0.6,2,1>]
>       [1    color rgbt <1,1,1,1>]
>     }
>   }
>   finish {ambient 1}
> }
>
> object{
>   skull26__null__
>   translate 0.1*x
>   texture {XRayTexture}
>   no_shadow
> }
>
> object{
>   skull26__null__
>   rotate -y*90
>   texture {XRayTexture}
>   no_shadow
> }


Very cool! Looks terrific.
I think I will try it with a more simple object first, since I always have
problems to imagine how this slope maps really work. There also was a slope map
x-ray version with MakeHuman, but I didn't succeed to apply it to another
object. But obviously this slope map pattern is very versatile if one knows, how
to handle it. Thanks for the nice code.

And thanks to all the other good suggestions! I might try them one after
another.

Regards,

Simone


Post a reply to this message

From: SharkD
Subject: Re: XRay Test
Date: 13 Oct 2009 22:01:13
Message: <4ad530e9$1@news.povray.org>
On 10/13/2009 6:49 PM, Chris B wrote:
> Render of a skull using the slope pattern:
>
> #declare XRayTexture = texture {
> pigment {
> slope{z}
> pigment_map {
> [0 color rgbt 2*<1,1,1,0.1>]
> [0.75 color rgbt <0.1,0.6,2,1>]
> [1 color rgbt <1,1,1,1>]
> }
> }
> finish {ambient 1}
> }
> object{
> skull26__null__
> translate 0.1*x texture {XRayTexture}
> no_shadow
> }
>
> object{
> skull26__null__ rotate -y*90
> texture {XRayTexture}
> no_shadow
> }

Very nice! Is this MegaPOV only?

Mike


Post a reply to this message

From: Alain
Subject: Re: XRay Test
Date: 13 Oct 2009 22:46:57
Message: <4ad53ba1$1@news.povray.org>
SharkD a écrit :
> On 10/13/2009 6:49 PM, Chris B wrote:
>> Render of a skull using the slope pattern:
>>
>> #declare XRayTexture = texture {
>> pigment {
>> slope{z}
>> pigment_map {
>> [0 color rgbt 2*<1,1,1,0.1>]
>> [0.75 color rgbt <0.1,0.6,2,1>]
>> [1 color rgbt <1,1,1,1>]
>> }
>> }
>> finish {ambient 1}
>> }
>> object{
>> skull26__null__
>> translate 0.1*x texture {XRayTexture}
>> no_shadow
>> }
>>
>> object{
>> skull26__null__ rotate -y*90
>> texture {XRayTexture}
>> no_shadow
>> }
> 
> Very nice! Is this MegaPOV only?
> 
> Mike

No!

The slope pattern is a POV-Ray native feature.
In the windows version's documentation, look at section 3.5.11.30  Slope

In some cases, it can looks somewhat like the aoi texture from mega-POV.


Alain


Post a reply to this message

From: Chris B
Subject: Re: XRay Test
Date: 14 Oct 2009 03:49:18
Message: <4ad5827e$1@news.povray.org>
"mone" <mon### [at] alienenterprisesde> wrote in message 
news:web.4ad518671466e24f66e6d7c00@news.povray.org...
>
> I think I will try it with a more simple object first, since I always have
> problems to imagine how this slope maps really work. There also was a 
> slope map
> x-ray version with MakeHuman, but I didn't succeed to apply it to another
> object. But obviously this slope map pattern is very versatile if one 
> knows, how
> to handle it. Thanks for the nice code.
>

The main control on the slope pattern is a vector defining the orientation 
of the pattern. I used   'slope{z}'  in the example, along with a 
pigment_map which tells it that, everything aligned precisely with the 
z-axis is to be White with a tiny bit of transparency. It transitions to 
have progressively more transparency and a Blue color for surfaces that are 
not precisely aligned to the z-axis. It fades to completely transparent for 
surfaces at right angles to the z-axis.

It can be tricky to keep the direction of the slope pattern aligned to the 
camera. In the example, the second copy of the skull is rotated before 
applying the slope pattern (so that the slope pattern isn't rotated). As Sam 
mentioned it works best with an Orthographic camera, which makes it possible 
to keep the pattern aligned to the camera direction throughout the whole 
image. If you declare variables 'MyLocation' and 'MyLook_At' for the camera, 
then you can simply use  slope{MyLook_At-MyLocation}  to keep the pattern 
oriented towards the camera as you move the camera around (remembering not 
to rotate objects after applying the texture/pattern).

One word of warning. This is one of the few instances where working with too 
simple an object could actually be a little confusing, because you need some 
subtle surface changes on the object to be able to appreciate what's going 
on.

Regards,
Chris B.


Post a reply to this message

From: Thomas de Groot
Subject: Re: XRay Test
Date: 14 Oct 2009 03:53:20
Message: <4ad58370$1@news.povray.org>
Excelllent! Somebody had to think of this. :-)

Thomas


Post a reply to this message

From: Paolo Gibellini
Subject: Re: XRay Test
Date: 14 Oct 2009 04:43:32
Message: <4ad58f34@news.povray.org>
Very nice effect!
I'll give it a try.
;-)
Paolo

 >Chris B  on date 14/10/2009 00:49 wrote:
> Render of a skull using the slope pattern:
> 
> #declare XRayTexture = texture {
>  pigment {
>    slope{z}
>    pigment_map {
>      [0    color rgbt 2*<1,1,1,0.1>]
>      [0.75 color rgbt <0.1,0.6,2,1>]
>      [1    color rgbt <1,1,1,1>]
>    }
>  }
>  finish {ambient 1}
> }
> object{
>  skull26__null__
>  translate 0.1*x  texture {XRayTexture}
>  no_shadow
> }
> 
> object{
>  skull26__null__  rotate -y*90
>  texture {XRayTexture}
>  no_shadow
> }
> 
> ------------------------------------------------------------------------
>


Post a reply to this message

From: mone
Subject: Re: XRay Test
Date: 16 Oct 2009 20:20:01
Message: <web.4ad90cfb1466e24f18ebfdf70@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "mone" <mon### [at] alienenterprisesde> wrote in message
> news:web.4ad518671466e24f66e6d7c00@news.povray.org...

> The main control on the slope pattern is a vector defining the orientation
> of the pattern. I used   'slope{z}'  in the example, along with a
> pigment_map which tells it that, everything aligned precisely with the
> z-axis is to be White with a tiny bit of transparency. It transitions to
> have progressively more transparency and a Blue color for surfaces that are
> not precisely aligned to the z-axis. It fades to completely transparent for
> surfaces at right angles to the z-axis.

That does sound logical. However I wonder how you have figured out the correct
values, so it does look so good :).


>If you declare variables 'MyLocation' and 'MyLook_At' for the camera,
> then you can simply use  slope{MyLook_At-MyLocation}  to keep the pattern
> oriented towards the camera as you move the camera around (remembering not
> to rotate objects after applying the texture/pattern).

Yes. Thank you for the information, it was very helpful. I think the reason
because it didn't work at first was because I use to put the camera in the -z
direction. And than when the slope pigment is in the +z-direction everything is
much too bright and does not look like an x-ray texture at all. But when putting
"-z" behind slope everything looks fine. Likewise, when the camera is sitting in
the -z direction it seems to work whith MyLocation-MyLook_At  instead
MyLook_At-MyLocation.
I've tried both, with the slope pigment texture you suggested (I think I've
added a bit more ambient) and aoi, it looks both quite Ok, I think (see image
below), only with aoi it started to look strange when I tried to make it more
transparent.  I think it does work too, though, if people know how to use it
correctly, only I couldn't figure it out any better with my usual
trial-error-approach. :)

Best Regards,

Simone

//////////////////////////////////////
#version unofficial megapov 1.1;

#include "Brain_POV_geom.inc" //Geometry

#declare cam_location=  <0.0, 0.0, -18.0>  ;
#declare cam_look_at=  <0.0, 0.0, 0>  ;


camera {
  location  cam_location   angle 30
  look_at  cam_look_at
  right     x*image_width/image_height
}


#declare XRayTexture2 = texture {
  pigment {
    slope{cam_location-cam_look_at}
    pigment_map {
      [0    color rgbt 2*<1,1,1,0.1>]
      [0.75 color rgbt <0.1,0.6,2,1>*1]
      [1    color rgbt <1,1,1,1>]
    }
  }
  finish {ambient 3}
}


 #declare Brain_  = object {
 object { Brain_   Center_Trans (Brain_  , x+y+z)}
 }  ;


object{
      Brain_
 scale <.6,.6,.6>
 rotate <0,180,0>
 translate <-2,0,0>
 texture {XRayTexture2 }
}


object{
      Brain_
 scale <.6,.6,.6>
 rotate <0,180,0>
 translate <2,0,0>
texture {
    pigment {
        aoi
        color_map {[0 rgb 0]
                   [.5 rgbt <0.3, 0.35, 1,.5>*1]
                   [1 rgbt <1, 1, 1,1>*1]
        }
    }
    finish { ambient 4 diffuse 0}
}

}

////////////////////////////////////


Post a reply to this message


Attachments:
Download 'x_ray_test.jpg' (79 KB)

Preview of image 'x_ray_test.jpg'
x_ray_test.jpg


 

From: Chris B
Subject: Re: XRay Test
Date: 17 Oct 2009 04:27:54
Message: <4ad9800a@news.povray.org>
"mone" <mon### [at] alienenterprisesde> wrote in message 
news:web.4ad90cfb1466e24f18ebfdf70@news.povray.org...
> "Chris B" <nom### [at] nomailcom> wrote:
>
>> ..... It transitions to have progressively more transparency and a Blue
>> color for surfaces that are ...
>
> That does sound logical. However I wonder how you have figured out the 
> correct
> values...

Just trial and error I'm afraid, so no secret tricks to share :o)

> ... I think the reason it didn't work at first was because I use to put 
> the camera
> in the -z direction.

Ah yes! I usually do the same, but the skull model I'm doing is facing the 
other way to be consistent with some stuff other people are developing.

I think both your images look very good. I suspect the variation with real 
x-Ray photography can be quite large depending upon what the radiologist is 
trying to highlight.

Regards,
Chris B.


Post a reply to this message

From: mone
Subject: Re: XRay Test
Date: 17 Oct 2009 16:30:01
Message: <web.4ada28821466e24f2fa217c50@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "mone" <mon### [at] alienenterprisesde> wrote in message
> news:web.4ad90cfb1466e24f18ebfdf70@news.povray.org...
> > "Chris B" <nom### [at] nomailcom> wrote:
> >
> >> ..... It transitions to have progressively more transparency and a Blue
> >> color for surfaces that are ...
> >
> > That does sound logical. However I wonder how you have figured out the
> > correct
> > values...
>
> Just trial and error I'm afraid, so no secret tricks to share :o)

Oh, OK, so I'm not the only one :))


> I think both your images look very good.

Thanks :)). Though they aren't exactly much of my images because the effect on
the left was suggested by you and the model is a ready-made one.

> I suspect the variation with real
> x-Ray photography can be quite large depending upon what the radiologist is
> trying to highlight.

Yes, it's not too realistic for sure, but I don't care much because I was just
after a fancy looking effect, more or less. I think I will try to make a
composition with the brain and the head of the MakeHuman model - wont't work
with POV alone, because there's too much strange looking stuff inside the
MakeHuman model, which becomes visible when transparent, and csg doesn't seem to
work properly with this mesh. So I'll have too do it in post processing, but in
the end it will work somehow, I hope.

Best Regards,
Simone


Post a reply to this message

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