POV-Ray : Newsgroups : povray.binaries.images : Strange Result... : Strange Result... Server Time
5 Nov 2024 11:18:47 EST (-0500)
  Strange Result...  
From: Jörg 'Yadgar' Bleimann
Date: 17 Apr 2009 20:28:32
Message: <49e91eb0@news.povray.org>
High!

For my Solar System project (belated thanks, Lukas, for the hint about 
vrotate()!), I tried to generate a "spherical" mesh2 from a grayscale 
topographic map of the Martian moon Phobos (attached here) - but what I 
finally got the screen hasn't much in common with that potato-shaped 
little grey moon...

Here the code:

#declare PhobosRelief =
pigment
{
   image_map { png "solarsys/phobos_topo.png" }
}

mesh2 // Phobos
{
   vertex_vectors
   {
     320000
     #declare a=0;
     #while (a<400)
       #declare b=0;
       #while (b<800)
         ((8.1 + eval_pigment(PhobosRelief, <(0.5+b)*(1/800), 
(0.5+a)*(1/400), 0>).red * ((14-8.1)/255))
           * <sin(radians(b*(360/800)))*cos(radians(-90+a*(180/400))), 
sin(radians(-90+a*(180/400))), 
cos(radians(b*(360/800)))*cos(radians(-90+a*(180/400)))>)/sc,
         #declare b=b+1;
       #end
       #declare a=a+1;
     #end
   }
   face_indices
   {
     637602
     #declare a=0;
     #while (a<399)
       #declare b=0;
       #while (b<799)
         <a*400+b, a*400+b+1, (a+1)*400+b>,
         #if (b=798 & a=398)
           <319998, 319999, 319199>
         #else
           <(a+1)*400+b, (a+1)*400+b+1, a*400+b+1>,
         #end
         #declare b=b+1;
       #end
       #declare a=a+1;
     #end
   }
   texture
   {
     pigment { color rgb 0.3 }
     finish { F_Standard_Planetary_Surface }
   }
   rotate -y*100
   translate Pos_Phobos/sc

}

sc is currenty set to 13347, I tried it also with 500 and even 5, but 
that didn't change anything... what went wrong?

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2009-04-18 mars and phobos, take 2.jpg' (83 KB) Download 'phobos_topo.png' (72 KB)

Preview of image '2009-04-18 mars and phobos, take 2.jpg'
2009-04-18 mars and phobos, take 2.jpg

Preview of image 'phobos_topo.png'
phobos_topo.png


 

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