POV-Ray : Newsgroups : povray.off-topic : Guess the algorithm Server Time
11 Oct 2024 09:19:01 EDT (-0400)
  Guess the algorithm (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: scott
Subject: Re: Guess the algorithm
Date: 21 Nov 2007 09:01:12
Message: <47443a28@news.povray.org>
> Take a look at this:
>
> http://www.nullsoft.com/free/monkey/
>
> Anybody got any ideas what the cave-building algorithm is? (As in, I'd 
> like to copy it...)

How about this?

Thought I'd have a play about at lunch and this is the best I came up with 
(the black hole is a weird error due to a too low max_gradient).

I got some of the ideas form that nVidia presentation I posted, plus some 
random noise.  The core geometry is three "cylinders" that rotate around the 
z-axis in a circle at different rates.

Here's the functions to get the xy coords of the rotating tubes:

#declare fn_P1x = function(z) { 6*cos(z/19) }
#declare fn_P1y = function(z) { 6*sin(z/19) }
#declare fn_P2x = function(z) { 6*sin(z/11.2 + 2.6) }
#declare fn_P2y = function(z) { 6*cos(z/11.2 + 2.6) }
#declare fn_P3x = function(z) { 6*sin(z/17.12 - 8) }
#declare fn_P3y = function(z) { 6*cos(z/17.12 - 8) }

And here's the main isosurface function (it's all a bit messy):

#declare fn_X = function(x,y,z)
{
  6 / sqrt( pow((x)-fn_P1x(z),2) + pow((y+6)-fn_P1y(z),2)  ) - 1
 +4  / sqrt( pow(x-fn_P2x(z),2) + pow(y-fn_P2y(z),2)  ) - 1
 +7 / sqrt( pow(x-fn_P3x(z),2) + pow(y-fn_P3y(z),2)  ) - 1
 -1  *(noise(x/4,y/4,z/4)-.5)
}

Use a contained_by { box { <-20,-20,0>, <20,20,500> } } and view it from -z 
down the z axis.


Post a reply to this message


Attachments:
Download 'rock_tunnel 2.jpg' (77 KB)

Preview of image 'rock_tunnel 2.jpg'
rock_tunnel 2.jpg


 

From: Nicolas Alvarez
Subject: Re: Guess the algorithm
Date: 21 Nov 2007 10:35:29
Message: <47445041$1@news.povray.org>

>> Take a look at this:
>>
>> http://www.nullsoft.com/free/monkey/
>>
>> Anybody got any ideas what the cave-building algorithm is? (As in, I'd 
>> like to copy it...)
> 
> How about this?
> 
> Thought I'd have a play about at lunch and this is the best I came up 
> with (the black hole is a weird error due to a too low max_gradient).
> 

There are other tiny black holes at the back.

Can you easily get a path through the tunnels, for example to move the 
camera through it? :) How long did the render take?


Post a reply to this message

From: Darren New
Subject: Re: Guess the algorithm
Date: 21 Nov 2007 11:44:46
Message: <4744607e@news.povray.org>
scott wrote:
> How about this?

Mmmmm.  Bronchia.  Not shiny enough, tho.

Is this still off-topic, when you're posting POV code? :-)

-- 
   Darren New / San Diego, CA, USA (PST)
     It's not feature creep if you put it
     at the end and adjust the release date.


Post a reply to this message

From: Orchid XP v7
Subject: Re: Guess the algorithm
Date: 21 Nov 2007 13:15:46
Message: <474475d2$1@news.povray.org>
Wow! I just looked at this again at home, and I can see the whole 
tunnel! What I viewed it at work, there was a large black hole, with a 
narrow pink bit around the edges of the picture.

Jesus my monitor has an absurd gamma factor...


Post a reply to this message

From: scott
Subject: Re: Guess the algorithm
Date: 22 Nov 2007 02:50:19
Message: <474534bb@news.povray.org>
>> How about this?
>>
>> Thought I'd have a play about at lunch and this is the best I came up 
>> with (the black hole is a weird error due to a too low max_gradient).
>>
>
> There are other tiny black holes at the back.

Yeh, they're all max_gradient errors.  I was using 1 during testing, but 
even upping it to (IIRC) 5 in the final render they were still there.

> Can you easily get a path through the tunnels, for example to move the 
> camera through it? :)

Yep, I would just choose one of tunnels and move the camera along the centre 
line, should work assuming no huge noise part overlaps the centre of the 
tunnel.  A better way would be to find the maximum value of the isosurface 
at each xy slice and put the camera there.

> How long did the render take?

About 20 mins, but a smaller one with less AA and lower max_gradient should 
be way quicker.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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