POV-Ray : Newsgroups : povray.general : Problem: Colours and Effects aren't the same as Predefined Shapes in Isosur= Server Time
14 Nov 2024 23:21:40 EST (-0500)
  Problem: Colours and Effects aren't the same as Predefined Shapes in Isosur= (Message 1 to 3 of 3)  
From: mephuser
Subject: Problem: Colours and Effects aren't the same as Predefined Shapes in Isosur=
Date: 23 Jan 2005 03:40:01
Message: <web.41f3617e4a90639f3d54f5180@news.povray.org>
Problem: Colours and Effects aren't the same as Predefined Shapes in
Isosurface?

I'm unable to achieve the Translucent effect in the Isosurface Code. The
Translucent effect is NICE in the Predefined Shapes Code.


[Isosurface Code]
#include "colors.inc"

global_settings
{
  assumed_gamma 1.0
}

camera
{
  location  <0.0, .5, -4.5>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0, 0.0>
}

light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-30, 30, -30>
}

union
{

// Cylinder Middle
isosurface {
  function { pow(x,2) + pow(z,2) - pow(0.215,2) }
        accuracy 0.001
        threshold 0
        max_gradient 2
        contained_by{box{<-1,-0.5,-1>, <1,0.5,1>}}
        //texture{pigment {White} finish{specular 1}}
        texture{pigment {White filter 0.7} finish{specular 1}}
}

//Sphere Top
isosurface {
  function { pow(x,2) + pow(y,2) + pow(z,2) - pow(0.5,2) }
        accuracy 0.001
        threshold 0
        max_gradient 2
        //contained_by{sphere{0,0.78}}
        pigment {rgb .9}
        //texture{pigment {White} finish{specular 1}}
        texture{pigment {White filter 0.7} finish{specular 1}}
        translate <0, 0.78, 0>
}

//Sphere Bottom
isosurface {
  function { pow(x,2) + pow(y,2) + pow(z,2) - pow(0.5,2) }
        accuracy 0.001
        threshold 0
        max_gradient 2
        //contained_by{sphere{0,-0.78}}
        pigment {rgb .9}
        //texture{pigment {White} finish{specular 1}}
        texture{pigment {White filter 0.7} finish{specular 1}}
        translate <0, -0.78, 0>
}

// Cylinder Top
isosurface {
  function { pow(x,2) + pow(z,2) - pow(0.5,2) }
        accuracy 0.001
        threshold 0
        max_gradient 2
        contained_by{box{<-1,0.78,-1>, <1,1,1>}}
        //texture{pigment {White} finish{specular 1}}
        texture{pigment {White filter 0.7} finish{specular 1}}
}

// Cylinder Bottom
isosurface {
  function { pow(x,2) + pow(z,2) - pow(0.5,2) }
        accuracy 0.001
        threshold 0
        max_gradient 2
        contained_by{box{<-1,-0.78,-1>, <1,-1,1>}}
        //texture{pigment {White} finish{specular 1}}
        texture{pigment {White filter 0.7} finish{specular 1}}
}

}

[/Isosurface Code]



[Predefined Shape Code]

#include "colors.inc"

global_settings
{
  assumed_gamma 1.0
}

camera
{
  location  <0.0, .5, -4.5>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0, 0.0>
}

light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-30, 30, -30>
}

union
{
  cylinder{<0,-0.5,0>, <0,0.5,0>, 0.215}
  sphere{<0, .78, 0> 0.5}
  sphere{<0, -.78, 0> 0.5}
  cylinder{<0, .78, 0>, <0, 1, 0>, .5}
  cylinder{<0, -.78, 0>, <0, -1, 0>, .5}
  texture{pigment {White filter 0.7} finish{specular 1}}
}

[/Predefined Shape Code]


Post a reply to this message

From: Mike Williams
Subject: Re: Problem: Colours and Effects aren't the same as Predefined Shapes in Isosur=
Date: 23 Jan 2005 04:20:12
Message: <why$3BAFx28BFwbb@econym.demon.co.uk>
Wasn't it mephuser who wrote:
>Problem: Colours and Effects aren't the same as Predefined Shapes in
>Isosurface?
>
>I'm unable to achieve the Translucent effect in the Isosurface Code. The
>Translucent effect is NICE in the Predefined Shapes Code.

You just forgot to remove the line that says 
        pigment {rgb .9}
in some of the isosurfaces.

If you have two textures on an object, then they act as "layered
textures" (read the docs if you're unfamiliar with that concept) and you
see the opaque underlying {rgb 0.9} texture layer through the partially
transparent {White filter 0.7} texture layer.


>//Sphere Top
>isosurface {
>  function { pow(x,2) + pow(y,2) + pow(z,2) - pow(0.5,2) }
>        accuracy 0.001
>        threshold 0
>        max_gradient 2
>        //contained_by{sphere{0,0.78}}
>        pigment {rgb .9}
>        //texture{pigment {White} finish{specular 1}}
>        texture{pigment {White filter 0.7} finish{specular 1}}
>        translate <0, 0.78, 0>
>}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Slime
Subject: Re: Problem: Colours and Effects aren't the same as Predefined Shapes in Isosur=
Date: 23 Jan 2005 13:32:40
Message: <41f3edc8$1@news.povray.org>
> Problem: Colours and Effects aren't the same as Predefined Shapes in
> Isosurface?

After doing what Mike Williams said, you may also want to look at the
all_intersections keyword in the documentation.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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