POV-Ray : Newsgroups : povray.binaries.images : Isosurface Problem - how to create real ridges? Server Time
28 Mar 2024 15:37:56 EDT (-0400)
  Isosurface Problem - how to create real ridges? (Message 1 to 2 of 2)  
From: Jörg "Yadgar" Bleimann
Subject: Isosurface Problem - how to create real ridges?
Date: 10 Feb 2018 07:29:57
Message: <5a7ee5c5$1@news.povray.org>
Hi(gh)!

Returning to my "Whatmough" project from 2011, I now tried to create the 
entire planet Whatmough as an isosurface in the first place - by 
gleaning parameters from the heightfield generator software "Wilbur", 
which also uses the ridged multifractal function.

But something is strange: the ridges form grooves in the surface rather 
than sticking out as mountain ranges, as you can see in the attached 
image, I tried several combinations of positive and negative function 
parameters, but did not succeed in getting rid of this...

Here is the code:

#include "functions.inc"

#declare sc = 10000; // universal scaling factor

#declare T_Whatmough_Solid =
texture
{
   pigment { color rgb <0, 0.8, 0> }
   finish { ambient 0.05 diffuse 1 brilliance 1.5 }
}

#declare S =
function { x*x + y*y + z*z -1 } // spherical isosurface

#declare Whatmough_Terrain_Function =
function { S(x, y, z) +  f_ridged_mf(-x, -y, -z, 1, 1.9, 7, 1, 2, 1)/50 }

#declare Whatmough =
isosurface
{
   function { Whatmough_Terrain_Function(x,y,z)/2 }
   contained_by
   {
     sphere { 0, 1.2 }
   }
   max_gradient 20
   accuracy 0.00000001
   double_illuminate
   texture { T_Whatmough_Solid }
   scale 5902.45/sc
}

light_source
{
   0
   color rgb 1
   looks_like
   {
     sphere // HD 28185
     {
       0, 723528/sc
       pigment { color rgb 1 }
       finish { ambient 1 }
     }
   }
}

sphere // HD 28185 glow
{
   0, 1
   hollow
   texture
   {
     pigment { color rgbft <1, 1, 1, 0.5, 0.5> }
   }
   interior
   {
     media
     {
       emission rgb <1, 1, 0.82>/(723528*7/sc)
       density
       {
         spherical
         poly_wave 4
       }
     }
   }
   scale 723528*7/sc
}

#declare HD_28185_b =
sphere
{
   0, 1
   texture
   {
     pigment { color rgb <0.6, 0.6, 0.85> }
     finish { ambient 0.05 diffuse 1 brilliance 0.9 }
   }
   scale <68332, 67045, 68332>/sc
}

#declare HD_28185_b_Dist = 154200000/sc;
#declare HD_28185_b_AngPos = 156;
#declare HD_28185_b_Pos = 
HD_28185_b_Dist*<sin(radians(HD_28185_b_AngPos)), 0, 
cos(radians(HD_28185_b_AngPos))>;
#declare Whatmough_Dist = 912580/sc;
#declare Whatmough_AngPos = 254;
#declare Whatmough_Pos = HD_28185_b_Pos + 
Whatmough_Dist*<sin(radians(Whatmough_AngPos)), 0, 
cos(radians(Whatmough_AngPos))>;
#declare camDist = 30000/sc;
#declare cam_AngPos = 16;
#declare camPos = Whatmough_Pos + camDist*<sin(radians(cam_AngPos)), 0, 
cos(radians(cam_AngPos))>;


object
{
   HD_28185_b
   translate HD_28185_b_Pos
}

object
{
   Whatmough
   translate Whatmough_Pos
}

camera
{
   location camPos
   look_at Whatmough_Pos
   angle 40
}

Any suggestions?

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Kenneth
Subject: Re: Isosurface Problem - how to create real ridges?
Date: 10 Feb 2018 17:10:00
Message: <web.5a7f6c8c291aa3c1a47873e10@news.povray.org>
Try *subtracting* the Whatmough_Terrain_Function from the sphere function,
instead of adding it. That *looks* like it works.

Instead of this...
#declare Whatmough_Terrain_Function =
function { S(x, y, z) +  f_ridged_mf(-x, -y, -z, 1, 1.9, 7, 1, 2, 1)/50 }

Try this...
#declare Whatmough_Terrain_Function =
function { S(x, y, z) -  f_ridged_mf(-x, -y, -z, 1, 1.9, 7, 1, 2, 1)/15 }

(I exaggerated the terrain depth, just to see it more clearly.)

On the right-side hemisphere of the planet, I'm seeing a subtle but large
round-ish outline, which doesn't look like part of the actual terrain. I'm
wondering what that is.


Post a reply to this message

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