POV-Ray : Newsgroups : povray.binaries.images : POVghanistan Revisited! : Re: POVghanistan Revisited! Server Time
19 Apr 2024 19:29:23 EDT (-0400)
  Re: POVghanistan Revisited!  
From: Melody
Date: 24 Nov 2019 05:25:01
Message: <web.5dda58a86fbb8a6f9da690110@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:

> I shouldn't be too concerned about the dots presently. As Melody also
> suggests, once you add objects to the scene, especially in the
> foreground, the dots will become invisible or at least inconspicuous.
> The foreground texture(s) also will help. All that will be needed
> additionally to help hide the triangles of course.
>
> --
> Thomas

calculate normals of each point, respective to all adjacent faces and use smooth
triangles, lines go bye bye. iterate verts and compare to each triangle face.


#macro normal_vector(A,B,C)
 #local result = vcross(C-B,A-B);
 result
 // 1
 // |
 // 2__ 3 vz points at you (neg) unless reverse y like pov, then
 //
 // 2__ 3
 // |
 // 1
#end

#macro FastNorms77(sw)
  // set norms based on ALL adjacent faces-lots of verts means lots of time
  #local i=0;
  #while (i<NumVertices)
    #local nrm = <0,0,0>;
    #local j = 0;
    #while (j<NumFaces)
      #if ((i = Face_Arr[j].x)|(i = Face_Arr[j].y)|(i = Face_Arr[j].z))
        #local norm =
normal_vector(V_vec_Arr[Face_Arr[j].x],V_vec_Arr[Face_Arr[j].y],V_vec_Arr[Face_Arr[j].z]);
        #local nrm = vnormalize(nrm+vnormalize(norm));
      #end
      #local j=j+1;
    #end // Faces
    #declare N_vec_Arr[i] = nrm;
    #local i=i+1;
    #if (sw)  // Progress on/off
        #if (mod(100*i/NumVertices,20)<0.1)
          #debug concat("Checking Normals  >
",str(int(100*i/NumVertices),5,1),"%\n")
       #end
    #end
  #end // Verts
#end


Post a reply to this message

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