POV-Ray : Newsgroups : povray.general : deformed box Server Time
3 Nov 2024 01:11:56 EDT (-0400)
  deformed box (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Rafał Maj
Subject: deformed box
Date: 30 Mar 2008 22:11:15
Message: <47f05653@news.povray.org>
Hello,

does anyone have some quick working code to create like
box { -1000, +1000 }
but deformed a bit?

Perhaps a mesh, or set of 6 highfields with function() making the "texture".

Camera will be placed inside the box btw.

In general, it is aimed to represent a simple living room.


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: deformed box
Date: 30 Mar 2008 22:29:13
Message: <47f05a89@news.povray.org>
Rafał Maj escribió:
> Hello,
> 
> does anyone have some quick working code to create like
> box { -1000, +1000 }
> but deformed a bit?
> 
> Perhaps a mesh, or set of 6 highfields with function() making the "texture".
> 
> Camera will be placed inside the box btw.
> 
> In general, it is aimed to represent a simple living room.

How about just a normal perturbation?

box {
   <-100, 0,  -100>,
   < 100, 100, 100>
   pigment {
     color White
   }
   normal {
     granite 0.1
     scale 5
   }
}


Post a reply to this message

From: Rafał Maj
Subject: Re: deformed box
Date: 30 Mar 2008 22:36:22
Message: <47f05c36@news.povray.org>
Nicolas Alvarez wrote:

>> In general, it is aimed to represent a simple living room.
> 
> How about just a normal perturbation?
> 
> box {
>    <-100, 0,  -100>,
>    < 100, 100, 100>
>    pigment {
>      color White
>    }
>    normal {
>      granite 0.1
>      scale 5
>    }
> }

Helpfull, but I need higher quality - to deform actual shape - so that the
border betwen "walls" will not appear so straight artificial etc


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: deformed box
Date: 30 Mar 2008 23:59:55
Message: <47f06fcb$1@news.povray.org>
Rafał Maj escribió:
> Helpfull, but I need higher quality - to deform actual shape - so that the
> border betwen "walls" will not appear so straight artificial etc

Deforming actual shape = isosurface.

I think it would be a lot faster to use 6 isosurface "planes" than an 
actual box (intersection of planes in a single isosurface).


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: deformed box
Date: 31 Mar 2008 00:31:35
Message: <47f07737$1@news.povray.org>
Nicolas Alvarez escribió:
> Rafał Maj escribió:
>> Helpfull, but I need higher quality - to deform actual shape - so that 
>> the
>> border betwen "walls" will not appear so straight artificial etc
> 
> Deforming actual shape = isosurface.
> 
> I think it would be a lot faster to use 6 isosurface "planes" than an 
> actual box (intersection of planes in a single isosurface).

camera {
   location  <-20.0, 10.0, -10.0>
   direction 1.5*z
   look_at   <0.0, 9.0, 0.0>
}

light_source {
   <-10, 20, -15>
   color rgb 1
}

#declare Granite = function { pigment { granite scale 10 } };
union {
   isosurface {
     function { y-Granite(x,y,z).x*0.5 }
     contained_by {
       box {
         <-30, 0, -30>, <30, 1, 30>
       }
     }
     max_gradient 2.2
   }
   isosurface {
     function { z-Granite(x,y,-z).x*0.5 }
     contained_by {
       box {
         <-30, 0, 0>, <30, 30, 1>
       }
     }
     max_gradient 2.2
     scale <1,1,-1>
     translate z*30
   }
   isosurface {
     function { x-Granite(-x,y,z).x*0.5 }
     contained_by {
       box {
         <0, 0, -31>, <1, 30, 31>
       }
     }
     max_gradient 2.2
     scale <-1,1,1>
     translate x*30
   }
   pigment {
     color White
   }
}

Up to you to add the remaining three planes.


Post a reply to this message

From: Mike Williams
Subject: Re: deformed box
Date: 31 Mar 2008 00:41:22
Message: <s0+QvrCOlH8HFwRK@econym.demon.co.uk>
Wasn't it Nicolas Alvarez who wrote:

>I think it would be a lot faster to use 6 isosurface "planes" than an 
>actual box (intersection of planes in a single isosurface).

If you actually try it, it turns out to be slightly faster to use
   function { max((y*y-1),(x*x-1),(z*z-1)) +wobble(x,y,z) }
than to use the intersection of 6 isosurface "planes" that use the same 
contained_by (even though the "planes" use a lower max_gradient). 
There's not a huge difference.

I guess that if you were to create a tighter contained_by for each 
"plane", then you might get that to run faster, but I suspect that the 
gain would not be significant.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: deformed box
Date: 31 Mar 2008 00:54:52
Message: <47f07cac$1@news.povray.org>

> I guess that if you were to create a tighter contained_by for each 
> "plane", then you might get that to run faster, but I suspect that the 
> gain would not be significant.

Well I *am* using a tight containing box, which in my case is like 30 
times smaller than the room.

I'd be interested in knowing the speed comparison between your method on 
a single isosurface, and using six isosurfaces with separate planes but 
*with tight containing boxes*.


Post a reply to this message

From: Warp
Subject: Re: deformed box
Date: 31 Mar 2008 01:13:38
Message: <47f08112@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
> Deforming actual shape = isosurface.

> I think it would be a lot faster to use 6 isosurface "planes" than an 
> actual box (intersection of planes in a single isosurface).

  And I think it will be 100 times faster to use 6 heightfields instead
of 6 isosurfaces. The heightfields can be created using the same function
as the isosurfaces.

-- 
                                                          - Warp


Post a reply to this message

From: Maxime Marrow
Subject: Re: deformed box
Date: 31 Mar 2008 10:27:47
Message: <47f102f3@news.povray.org>
Rafał Maj wrote:
> Hello,
> 
> does anyone have some quick working code to create like
> box { -1000, +1000 }
> but deformed a bit?
> 
> Perhaps a mesh, or set of 6 highfields with function() making the "texture".
> 
> Camera will be placed inside the box btw.
> 
> In general, it is aimed to represent a simple living room.

#include "functions.inc"
global_settings { max_trace_level 20 }

background{1}

camera {
    location  2
    look_at   0
}

#local p = 2;
#local k = 0.6;

#local s = function { abs(abs(x + y) + abs(x - y) + z + z) + abs(abs(x + 
y) + abs(x - y) - z - z) - 4 }

#local d1 = function { x + k*f_noise3d(p*x, p*y, p*z) }
#local d2 = function { y + k*f_noise3d(100 + p*x, 100 + p*y, 100 + p*z) }
#local d3 = function { z + k*f_noise3d(200 + p*x, 200 + p*y, 200 + p*z) }

isosurface{
  function { s(d1(x, y, z), d2(x, y, z), d3(x, y, z)) }
  contained_by { box{ -1.1, 1.1 } }
  max_gradient 7

  pigment{rgb 0.7} finish{reflection{0, 1} diffuse 1 ambient 0}
}

This scene renders for about 22 seconds on my computer in 640x480 
resolution without anti-aliasing, which is pretty quick for me. If you 
want lower/higher bumps adjust k. If you want more/less bumps adjust p.

Maxime


Post a reply to this message

From: Rafał Maj
Subject: Re: deformed box
Date: 31 Mar 2008 13:25:50
Message: <47f12cae@news.povray.org>
Maxime Marrow wrote:

> isosurface{
>   function { s(d1(x, y, z), d2(x, y, z), d3(x, y, z)) }
>   contained_by { box{ -1.1, 1.1 } }
>   max_gradient 7

> This scene renders for about 22 seconds on my computer in 640x480
> resolution without anti-aliasing, which is pretty quick for me. If you
> want lower/higher bumps adjust k. If you want more/less bumps adjust p.

The scene is slow even with a plain box { } 

So I was hoping for a solution that would operate on mesh


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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