POV-Ray : Newsgroups : povray.general : Groove in isosurface Server Time
2 Nov 2024 15:27:26 EDT (-0400)
  Groove in isosurface (Message 1 to 5 of 5)  
From: Rafal 'Raf256' Maj
Subject: Groove in isosurface
Date: 18 Jan 2004 02:10:31
Message: <Xns947452D7EA9CBraf256com@204.213.191.226>
Hi,
I want to groove out (cut out) from isosurface shape (that reassembles an 
box) a text (or other height-field-shape)

Hf is "hf.bmp" or "hf.bmp", 8 bit depth would be enought.


isosurface functions is say[1]:


function {
    -1
    +pow(abs(x),5)+pow(abs(y),5)+pow(abs(z),5)
}

now, how to make in forward Z wall (-z wall, close to camera at i.e. -z*10)
a hole, more or less deep (longer into +z direction) basing on colors in 
hf.bmp?


[1] btw, the actual function represents a peace of wood, so box is strongly 
distored:


  function {
    -1
    +pow(abs(x/X) 
+f_noise3d(x,y+TT,z)*.1,5)+pow(abs(y/Y)+f_noise3d(x,y+TT,z)*.1,5)+pow(abs(z
/Z) +f_noise3d(x,y+TT,z)*.04,5)
    + pow(max(abs(y)-9.0,0)*2,2) 
    + pow(f_noise3d(x* 9,y* 9*0.3,z* 9+TT2),2.5)*0.18 // med 
    + pow(f_noise3d(x*26,y*26    ,z*17+TT2),2.5)*0.05 // small    
  }

i'll post in .b.i when ready


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Mike Williams
Subject: Re: Groove in isosurface
Date: 18 Jan 2004 03:21:43
Message: <$0EsSAAl+jCAFwei@econym.demon.co.uk>
Wasn't it Rafal 'Raf256' Maj who wrote:
>Hi,
>I want to groove out (cut out) from isosurface shape (that reassembles an 
>box) a text (or other height-field-shape)

Use difference in exactly the same way that you would with an ordinary
box, except that you need to specify a suitable max_trace within the
isosurface.

difference {
  isosurface {
    function {F(x,y,z)}
    max_gradient 1.7
    contained_by{sphere{0,1}} open
    max_trace 3
  }
  text {
    ttf "crystal.ttf", "GROOVE",0.2,0
    rotate x*90
    translate <-1.5,0.1,-0.5>
    scale 0.3
  }
  pigment {rgb 1}
}

Hint: If you can't see your groove, try temporarily changing
"difference" into "union" so you can see which direction you have to
translate it in order to get it to intersect the correct part of your
isosurface.

It's probably not a good idea to try to make your text or heightfield
into an isosurface function if it has sharp edges since you're likely to
get infinite function gradients.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Groove in isosurface
Date: 18 Jan 2004 10:26:45
Message: <Xns9474A6F9E30Craf256com@204.213.191.226>
nos### [at] econymdemoncouk news:$0EsSAAl+jCA### [at] econymdemoncouk

> Hint: If you can't see your groove, try temporarily changing
> "difference" into "union" so you can see which direction you have to
> translate it in order to get it to intersect the correct part of your
> isosurface.
> 
> It's probably not a good idea to try to make your text or heightfield
> into an isosurface function if it has sharp edges since you're likely to
> get infinite function gradients.
> 

I want the height-field to be a part of isosurface function, so I can i.e. 
displace or wrap it, like I can with any isosurface function

-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Mike Williams
Subject: Re: Groove in isosurface
Date: 18 Jan 2004 23:26:21
Message: <tykITAAks1CAFw9n@econym.demon.co.uk>
Wasn't it Rafal 'Raf256' Maj who wrote:
>nos### [at] econymdemoncouk news:$0EsSAAl+jCA### [at] econymdemoncouk
>
>> Hint: If you can't see your groove, try temporarily changing
>> "difference" into "union" so you can see which direction you have to
>> translate it in order to get it to intersect the correct part of your
>> isosurface.
>> 
>> It's probably not a good idea to try to make your text or heightfield
>> into an isosurface function if it has sharp edges since you're likely to
>> get infinite function gradients.
>> 
>
>I want the height-field to be a part of isosurface function, so I can i.e. 
>displace or wrap it, like I can with any isosurface function

I presume that you've tried making a function from your heightfield
image and adding it to your isosurface function and found problems with
that. Here are a few alternative approaches.

1. If your only problem with that approach is due to the infinite
gradients caused by sharp edges in your image, then you could try pre-
processing your heightfield image to apply some form of blurring or
smoothing.

2. Don't knock it until you've tried it: Use your heightfield image as a
bump_map. I know it's not true 3D, but it can often look pretty good.

3. Since you're using the isosurface to generate a simple modification
from a box, you might try approaching the problem from the other
direction. Use the function that you were perturbing your isosurface
with to create a pigment. Use that pigment to create an image. Use that
image as six intersecting heightfields to create a warped box. Blend
your groove heightfield with a copy of this structural heightfield.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Tom Melly
Subject: Re: Groove in isosurface
Date: 19 Jan 2004 04:50:19
Message: <400ba85b$1@news.povray.org>
"Mike Williams" <nos### [at] econymdemoncouk> wrote in message
news:tyk### [at] econymdemoncouk...

> I presume that you've tried making a function from your heightfield
> image and adding it to your isosurface function and found problems with
> that. Here are a few alternative approaches.

That *might* be an assumption too far - Rafal, check the thread "Leveller 2 and
using hf pigments in iso-functions".


Post a reply to this message

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