POV-Ray : Newsgroups : povray.newusers : Pov-Ray Scene Help ?! : Re: Pov-Ray Scene Help ?! Server Time
5 Nov 2024 03:18:36 EST (-0500)
  Re: Pov-Ray Scene Help ?!  
From: Norbert Kern
Date: 18 Jun 2002 17:09:37
Message: <3d0fa191@news.povray.org>
hi,


hfsphere.pov : http://www.oyonale.com/ressources/english/sources09.htm)



//=========================================
// Wrapping a height field on a sphere
// (c) 2000-2001 Gilles Tran tra### [at] inapginrafr

// adapted by Norbert Kern (nor### [at] t-onlinede) to create a
realistic 3d moon

//-----------------------------------------
// This demo file shows an example of wrapping a height field on a sphere
// Requires POV-RAy 3.5

#include "colors.inc"
#include "functions.inc"

#include "textures.inc"
#include "metals.inc"

// ----------------------------------------
global_settings {max_trace_level 3}
camera {
  location  <0,0.5,-4>
  direction 1.5*z
  right     4/3*x
  look_at   <0,0,0>
}

background{color rgb 0}
light_source{<1000,1000,-1000> color rgb 1}

// ----------------------------------------

// First we declare a function with the map_type 1 (spherical) mapping

#declare hfmoon = function {pigment {image_map {jpeg "Moonbump" map_type 1
interpolate 2}}}
#declare rs = 0.1; // try several rs values <0.1; the lower it is the more
realistic is the effect and the more "flat" is the moon
isosurface{
        function {f_sphere(x,y,z, 1) + rs - hfmoon(x,y,z).hf*rs}
        contained_by {sphere{0,1}}
        max_gradient 20 // <--- important- adjust to your picture otherwise
strange things happen
        texture {pigment {image_map {jpeg "moonmap" map_type 1 interpolate
2}}}
        /*
        rotate y*-15
        rotate x*-20
        */
}


Pov-Ray 3.5 beta is essential.
The hereby needed files MoonMap.jpg and MoonBump.jpg are from
http://snorkel.rtfm.com.au/~om/graphics/Textures/Planets%20and%20Satellites/
planets_and_satellites.htm.


Good luck
Norbert



"maheshtd" <mah### [at] onetelnetuk> schrieb im Newsbeitrag
news:3d0f2c90@news.povray.org...
> How do i create a realistic looking moon in pov-ray. I've attempted to
> re-create
> the moon. But it dosen't look anything like it, it looks more like a
> golfball stuck in the
> middle of the canvas. I tried using image maps but these look dull and
flat
> and nothing
> seemed to work out as i did.  When i rendered the scene in pov-ray it
looked
> like a 2d
> object just flat.
>
> In the pov-ray help files, it illustrates how to create the sun, for the
> image i wanted to create the sun
> behind the  moon sphere. When i render it the sun is nowhere to be seen .
>
> Thanks in advance.
>
>
>
>
>
>
>


Post a reply to this message

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