POV-Ray : Newsgroups : povray.newusers : Need Help: Isosurface, cosinus and inverted textures Server Time
25 Dec 2024 22:12:02 EST (-0500)
  Need Help: Isosurface, cosinus and inverted textures (Message 1 to 7 of 7)  
From: kaneda
Subject: Need Help: Isosurface, cosinus and inverted textures
Date: 25 Jun 2007 10:45:01
Message: <web.467fd4659e4618474729c3380@news.povray.org>
Hi!

I tried to make something small with isosurfaces and it doesn't map the
textures correctly. That's how it looks like: (
http://img339.imageshack.us/img339/7260/untitled3pw8.png ).

As you can see, the texture-pattern changes depending on the cosinus. Does
anyone have an idea how to prevent that? I really don't get why it does
that :<

Any solution would truly be great so thanks a lot in advance! :D

This is the code:

  #include "colors.inc"
  #include "textures.inc"

  camera {
 location <5,5,-9>
 look_at <0,-2,0>
  }
  light_source {<1,1,-1>*50 color rgb 1}

  isosurface {
 function {(cos(sqrt(x*x+z*z)) + y)}
 threshold   1
 max_gradient  1.5
 contained_by {box {<-4,-2,-4>,<4,2,4>}}
 pigment {
  checker
  color Black
  color White
 }
  }


Post a reply to this message

From: Marc
Subject: Re: Need Help: Isosurface, cosinus and inverted textures
Date: 25 Jun 2007 11:40:47
Message: <467fe1ff@news.povray.org>

web.467fd4659e4618474729c3380@news.povray.org...
> Hi!
>
> I tried to make something small with isosurfaces and it doesn't map the
> textures correctly. That's how it looks like: (
> http://img339.imageshack.us/img339/7260/untitled3pw8.png ).
>
> As you can see, the texture-pattern changes depending on the cosinus. Does
> anyone have an idea how to prevent that? I really don't get why it does
> that :<
>
Checker pattern is actually a 3D cubic pattern.
It shows where it intersect with the surface unless you uv_map it
I don't see any solution with isosurface since it doesn't accept uv_mapping

Marc


Post a reply to this message

From: Samuel Benge
Subject: Re: Need Help: Isosurface, cosinus and inverted textures
Date: 26 Jun 2007 01:39:04
Message: <4680a678@news.povray.org>
kaneda wrote:
> As you can see, the texture-pattern changes depending on the cosinus. Does
> anyone have an idea how to prevent that? I really don't get why it does
> that :<
> 
> Any solution would truly be great so thanks a lot in advance! :D

Hi Kaneda,

I'm going to assume you want the checker to follow the contour of the 
isosurface. There is a way to do this.

To make it work, you will need to turn the pigment into a function and 
then distort it with the same function you use to distort the 
isosurface. I modified your code to show how this is done:

#declare chckr= // a pigment encased in function{...} brackets
function{
  pigment {
   checker
   rgb .05, rgb 1
   translate 0.5 // offset to prevent coincident surface artifacts
  }
}

#declare f= // the ripple
function{
  cos(sqrt(x*x+z*z))
}

isosurface {
  function {
   f(x,y,z) // the ripple
   + y      // the y-facing surface
  }
  threshold   1
  max_gradient  1.5
  contained_by {box {<-4,-2,-4>,<4,2,4>}}
  pigment{
   function{
    // note the ripple's function added to the
    // y axis of the chckr function
    chckr(
     x,
     y+f(x,y,z),
     z
    ).grey
    // all pigment functions must end in .grey,
    // .x, .y or .z (r, g, b, respectively)
   }
  }
}

I hope this helps!

~Sam


Post a reply to this message

From: kaneda
Subject: Re: Need Help: Isosurface, cosinus and inverted textures
Date: 26 Jun 2007 13:25:02
Message: <web.46814afa97c52c6bd8221a0e0@news.povray.org>
Wow, that helped a lot! Thanks!!!!

Uhm... but how can i use a texture instead of a pigment on that isosurface
now? Originally it was something like

texture {
  checker
  texture {
    pigment {
      White_Marble turbulence 1
      scale 3
    }
  }
  texture {
    pigment {
      gradient x
      pigment_map {
        [0.2 rgb <0.1,0,0>  turbulence 1]
        [0.7 Black]
      }
    }
  }
}

but that doesn't work anymore as povray doesn't seem to accept textures as
functions *sigh* :<


Post a reply to this message

From: Marc
Subject: Re: Need Help: Isosurface, cosinus and inverted textures
Date: 26 Jun 2007 14:41:51
Message: <46815def@news.povray.org>

web.46814afa97c52c6bd8221a0e0@news.povray.org...
> Wow, that helped a lot! Thanks!!!!
>
> Uhm... but how can i use a texture instead of a pigment on that isosurface
> now? Originally it was something like
You can use a pigment as pattern for a texture with pigment_pattern
http://www.povray.org/documentation/view/3.6.1/388/

Use your pigment function for this pattern

Marc


Post a reply to this message

From: kaneda
Subject: Re: Need Help: Isosurface, cosinus and inverted textures
Date: 2 Jul 2007 09:55:02
Message: <web.4689031f97c52c6b4729c3380@news.povray.org>
Wow that worked brilliantly. You're my personal hero of the month!

But everytime i solve one problem I come across yet another one: The first
one was that I couldn't put 2 finishes on the isosurface, which was
possible on the checker texture before. But the difference isn't that
great, so I can live with it.

But..... now the color of the isosurface is always monochrome, even though
the black tiles should be red D: I don't get it.

 #declare pigment1 = // pigment for the white tiles
 pigment{
  White_Marble turbulence 1
 }

 #declare pigment2 = // pigment map for the black tiles
 pigment{
  gradient x
  pigment_map {
   [0.2 rgb <.1,0,0> turbulence 1]
   [0.7 Black]
  }
  turbulence 0.7
 }

 #declare chckr = // a pigment encased in function-brackets
 function{
  pigment {
   pigment_pattern {checker White, Black}
   pigment_map {
    [ 0, pigment1 ] // Using the predefined Pigment 1
    [ 1, pigment2 ] // Using the predefined Pigment 2
   }
  }
 }

 isosurface {
  function {(f(x,y,z) + y)
  }
  threshold 1
  max_gradient 1.5
  contained_by { box {<-4,-2,-4>,<4,2,4>}}
  pigment{
   function{
    chckr(
     x,
     y+f(x,y,z),
     z
    ).gray
   }
  }
  finish {
   specular   1/5
   roughness  0.1
   phong    0.6
   phong_size 100
   reflection 0.33
  }
 }


Post a reply to this message

From: kaneda
Subject: Re: Need Help: Isosurface, cosinus and inverted textures
Date: 2 Jul 2007 10:20:01
Message: <web.468908d497c52c6b4729c3380@news.povray.org>
Nevermind, got it already :D


Post a reply to this message

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