POV-Ray : Newsgroups : povray.binaries.images : Coffee's On - again : Re: Coffee's On - again Server Time
5 Nov 2024 12:40:19 EST (-0500)
  Re: Coffee's On - again  
From: Trevor G Quayle
Date: 20 Jul 2007 08:20:01
Message: <web.46a0a7af487a5d69c150d4c10@news.povray.org>
Kyle <hob### [at] gatenet> wrote:
> Hey Trevor,
>
> How did you make the coffee stains?

It is just a simple cylidrical-based pigment function. I map it to a disc
object and place it very slightly above the surface of the base object.  I
could put it directly into an object's material, but it is easier to work
with this way.

Actually the most difficult part was getting the right colouration.  I ended
up having to use both transmit and filter to get what I thought looks right.
 First time I've used both...

See code below.  Coffee cup ring is similar, with appropriate colour
mapping.  You can also play with the turbulence and scaling factor to get
various efffects.

-tgq

//CODE
//START
#declare CDRND=seed(0);
#macro CDrop(SIZ)
disc{0,y,1.0
  #local YT=1000*rand(CDRND);
  #local YR=360*rand(CDRND);
  pigment{
    cylindrical
    pigment_map{
      [0.145 rgbt 1]
      [0.15 rgbft <0.5,0.3,0.1,0.1,0.1>]
      [0.25 spotted
        colour_map{
          [0 rgbft <0.5,0.3,0.1,0.50,0.50>]
          [1 rgbft <0.5,0.3,0.1,0.30,0.70>]
        }
        scale 0.1
      ]
    }
    warp{black_hole <0.8,-YT,0>,0.75 inverse strength 1}//creates thickened
spot on edge
    #declare SCL=30;
    scale SCL
      warp {
        turbulence 0.25
        octaves 2
        lambda 1
        omega 0.75
      }
    scale 1/SCL
    warp{turbulence 0.1}
    translate y*YT
    rotate y*YR
  }
  finish{
    ambient 0
    diffuse 0.6
    conserve_energy
  }
  scale SIZ
  translate -y*39.9
}
#end
//END


Post a reply to this message

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