POV-Ray : Newsgroups : povray.binaries.images : POVghanistan Revisited! Server Time
29 Mar 2024 02:08:23 EDT (-0400)
  POVghanistan Revisited! (Message 11 to 18 of 18)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Melody
Subject: Re: POVghanistan Revisited!
Date: 24 Nov 2019 20:00:00
Message: <web.5ddb258b6fbb8a6f9da690110@news.povray.org>
> Perhaps too tough for me... I don't have the faintest clue how to
> integrate the output of these functions (i. e. N_vec_Arr[])! Where shall
> I invoke the macro - inside the mesh2 object?

Once you got verts and faces set, just call FastNorms77(1)
It simply defines your Normals. Then you are ready to define a mesh.

OK,so.
you might know NumVertices. if not, you guess at first, or you could make
function to count them.

here we are guessing, later we count and reset NumVertices.
basically stacks*slices, or some known dimensions.
over estimate if guessing, don't under estimate.

initially:
   #declare NumVertices = stacks*slices;

   #declare V_vec_Arr=array[NumVertices]
   #declare N_vec_Arr=array[NumVertices]
   #declare UV_vec_Arr=array[NumVertices]
   #declare NumEdges = 0;
   #declare Edge_Arr=array[NumVertices]
   #declare NumFaces = 0;
   #declare Face_Arr=array[NumVertices*2]
   cr() echof(NumVertices) echo(" Allocated")
(see echo.inc - cr() =carriage return, #debug float, #debug "string")
then you can see your allocated estimate, to see if later it looks too big, etc.

NumFaces might average twice the NumVertices.

legend
V = Vertices
N = Normals
UV = UV (for mapping)

NEXT
Define Vertices
V_vec_Arr[i] = <,,>; // (some 3d point)

NEXT
NumFaces are counted and set, when faces are defined.
<1,2,3> integers in the range of NumVertices

hope this helps,
Melody


Post a reply to this message

From: Melody
Subject: Re: POVghanistan Revisited!
Date: 24 Nov 2019 21:55:00
Message: <web.5ddb419b6fbb8a6f9da690110@news.povray.org>
write the file and save, could be a plan, or
V N V N V N
#macro SmoothTriangles(c)
     #local i=0;
     mesh {
        #while (i<NumFaces)
             smooth_triangle {
               V_vec_Arr[Face_Arr[i].x]
               N_vec_Arr[Face_Arr[i].x]
               V_vec_Arr[Face_Arr[i].y]
               N_vec_Arr[Face_Arr[i].y]
               V_vec_Arr[Face_Arr[i].z]
               N_vec_Arr[Face_Arr[i].z]
             }
           #local i=i+1;
        #end
     }
#end

got everything defined? mesh2 is map able.
#macro _Surface()
   mesh2 {
      #local i = 0;
      vertex_vectors {
         NumVertices
         #while (i<NumVertices)
            V_vec_Arr[i]
            #local i = i+1;
         #end
      }
      #local i = 0;
      normal_vectors {
         NumVertices
         #while (i<NumVertices)
            N_vec_Arr[i]
            #local i = i+1;
         #end
      }
      #local i = 0;
      uv_vectors {
         NumVertices
         #while (i<NumVertices)
            UV_vec_Arr[i]
            #local i = i+1;
         #end
      }
      #local i = 0;
        echo("\nNum _Surface() Faces ") echoi(NumFaces)
      face_indices {
         NumFaces
         #local i = 0;
         #while (i<NumFaces)
            Face_Arr[i]
            #local i = i+1;
         #end
      }
}
#end


Post a reply to this message

From: Melody
Subject: Re: POVghanistan Revisited!
Date: 25 Nov 2019 00:50:02
Message: <web.5ddb6a896fbb8a6f9da690110@news.povray.org>
now I remember, rebel_snowspeeder
was defined by an image map of the Grand Canyon. all u do i this:
height_field { tga "gce.tga" smooth
  scale <1000, 100, 1000>*10
  translate <-500, -100,0>*10

  texture {
    pigment { color white }
    finish { ambient 0.6 reflection 0 diffuse 0.4 }
  }
}

DEM2POV v1.2a

Converts USGS Digital Elevation Model data files to tga height-field for
POV raytracer. converted W. D. Kirby, 30 mar 96. hacked from dem2xyz.c
18 apr 95. converts 3 arc second to lat/long, sol katz, mar. 94. added
sampling and cutting to size, sol katz, apr 94. changed the calculation
of start position in sampling code, sol katz, jan 95.

here's an png


Post a reply to this message


Attachments:
Download 'gce.png' (1317 KB)

Preview of image 'gce.png'
gce.png


 

From: Melody
Subject: Re: POVghanistan Revisited!
Date: 25 Nov 2019 02:45:01
Message: <web.5ddb85286fbb8a6f9da690110@news.povray.org>
=?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
> Where shall I invoke the macro - inside the mesh2 object?

for some reason the assumption was a mesh, then Thomas mentioned height_field.
so I did some digging.

Digital elevation was not confirmed; we got on meshes.
With the mesh code, you can make anything u have points for,
or for anything you can logic calculating.


Post a reply to this message

From: Melody
Subject: Re: POVghanistan Revisited!
Date: 25 Nov 2019 04:25:00
Message: <web.5ddb9cce6fbb8a6f9da690110@news.povray.org>
https://www2.jpl.nasa.gov/srtm/cbanddataproducts.html
"If you want to download SRTM data, those data are available at the US
Geological Survey's EROS Data Center for download. "
supposed to be here,
http://srtm.usgs.gov/index.html

I cant get in.



http://www.webgis.com/terr_us1deg.html
has dem files - 2 tests fail for same reason, this sucks
dem2pov.exe
CALCULATED column Count 1 != HEADER 350
       will use SMALLER column Count
number of rows 1, number of columns 1

1x1 is nothing

post dem file downloads, if anyone knows.


Post a reply to this message

From: Melody
Subject: Re: POVghanistan Revisited!
Date: 25 Nov 2019 04:50:01
Message: <web.5ddba27c6fbb8a6f9da690110@news.povray.org>
for a dem file that works, (cant find any on the net.)
use the vertical scale input of 20 for this image.
1 = shades of only green.

number of rows 1201, number of columns 1201
Enter 0 for all,  1 for samples,  2 for subset : 0
Height-field type (0) Actual heights (1) Normalized : 0
Enter a vertical scaling factor : 20
Enter elevation bias: 0
Enter default elevation (final output units) : 1 (I dont know this one)

The last interactive input defines a default elevation in the output
units to be used for those pixel points where DEM data are not
available. This is useful for eliminating sharp changes at the
height-field edges where sparse data situations may occur.

even still ... lol wth?


Post a reply to this message


Attachments:
Download 'gce.jpg' (654 KB)

Preview of image 'gce.jpg'
gce.jpg


 

From: Alain Martel
Subject: Re: POVghanistan Revisited!
Date: 25 Nov 2019 12:29:35
Message: <5ddc0f7f$1@news.povray.org>

> the scene looks like a billion points,
> so I would say isolate local points for mesh of smooth triangles.
> 
> I might have more ideas when I have time to look that this Grand Canyon DEM
> used here. smooth smooth.
> 
> but height_field I recall seeing triangles, but there's a smoothing command?
> I dont really remember exactly.
> 

hight_field{DefinitionOfHightField   smooth   AnyTransformAndTecture}


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: POVghanistan Revisited!
Date: 26 Nov 2019 19:39:47
Message: <5dddc5d3@news.povray.org>
Hi(gh)!

On 25.11.19 18:29, Alain Martel wrote:



It's not a heightfield, but a spherical (i. e. following Earth's 
curvature) mesh2 derived from a PNG, which in turn has been generated 
from an ASCII data matrix!

See you in Khyberspace!

Yadgar


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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