POV-Ray : Newsgroups : povray.binaries.images : Easter People will dig this one Server Time
5 May 2024 01:34:44 EDT (-0400)
   Easter People will dig this one (Message 1 to 10 of 24)  
Goto Latest 10 Messages Next 10 Messages >>>
From: alphaQuad
Subject: Easter People will dig this one
Date: 10 Mar 2008 15:15:01
Message: <web.47d59608ecd6bed7f12d29b40@news.povray.org>
or is it a spaceship...


From paramx.inc

 A unit sphere may look like this:
#declare Fx = function(U,V){sin(U)*cos(V)}
#declare Fy = function(U,V){cos(U)}
#declare Fz = function(U,V){sin(U)*sin(V)}
Parametric()
CalcSurf()
etc.
#declare Lynks = union

Well that MAY NOT make a sphere as it fails. Got many others to work, but no
sphere and no flattening. So failing Parametric(), got busy.


*************** Segement4.pov *************************
#include "stdinc.inc" // colors
#include "metals.inc"

#include "echo2.inc"

//#declare _radiosity = 0;
//#include "radiosity.inc"

#include "spheroid.inc"
spheroid(1.4, 0.0, 0.2, 0.2, 16, 32)

#macro VertexSpheres(Radius)
   #local i=0;
   #while (i<NumVertices)
     sphere{V_vec_Arr[i], Radius}
     #local i=i+1;
   #end
#end

#macro By_Edges(Radius)
  #local i=0;
  #while (i<NumEdges)
    #local uv = Edge_Arr[i];
    cylinder { V_vec_Arr[Edge_Arr[i].x],V_vec_Arr[Edge_Arr[i].y],Radius }
    #local i = i+1;
  #end
#end



union {
  By_Edges(0.05)
  VertexSpheres(0.052)
  texture { T_Chrome_1C }
rotate <0,0,0>
//rotate <0,0,0>
translate <0,0,0>
}



camera {
location < 0.0,1.0,-20.0 >
look_at < 0.0,0.0,0.0 >
angle 14
}

light_source {
<0.0,15.0,-15.0>
color Red
fade_distance 80
fade_power 2
}
light_source {
<40,0.5,-40>
color Green
fade_distance 80
fade_power 2
}
light_source {
<-20,5,-50>
color Blue
fade_distance 80
fade_power 2
}
#declare fl_chrome1c =
plane { y, -1.2 texture { T_Chrome_1C }
}
object { fl_chrome1c }
#declare sky_blue =
sky_sphere {
    pigment {
        gradient y
        color_map {
          [0.0 rgb <0.6,0.7,1.0>]
          [0.7 rgb <0.0,0.1,0.8>]
        }
    }
}
sky_sphere { sky_blue }





((((((((((((((((( #include spheroid.inc )))))))))))))))))

#macro round(f,n)
 #local c = floor(pow(10.0,n));
 #local dd = 0.5 / c;
 #local dd = dd + abs(f);
 #local dd = dd * c;

 #local dd=floor(dd);
 #local dd = dd/c;
 #if (f < 0.0) #local dd = dd * -1; #end
 (dd)
#end

#macro spheroid(Radius, xflat, yflat, zflat, stacks, slices)

   #declare NumVertices = numverts(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*4]

  #local i = 0;
  #local j = 0;

  #local k = 0;
  #local drho = pi / stacks;
  #local dtheta = pi*2 / slices;
  #local s1 = 1; #local s2 = 1; #local e1 = 1; #local e2 = 1;

  #while (i <= stacks)
    #local rho = i * drho;
    #local s = sin(rho);
    #local c = cos(rho);
    #local j = 0;
    #if (floor(slices * s) > 1) #local n = floor(slices * s);
    #else #local n = 1; #end

    #local dtheta = pi*2 / n;
    #local s1 = s2;
    #local s2 = k + 1;

    #while (j < n)
      #local theta = j * dtheta;
      #local _x = sin(theta) * s;
      #local _y = c;
      #local _z = cos(theta) * s;

      #local _x = _x * Radius * (1.0 - xflat);
      #local _y = _y * Radius * (1.0 - yflat);
      #local _z = _z * Radius * (1.0 - zflat);
      #declare V_vec_Arr[k] = <_x,_y,_z>;
      #local j=j+1;
      #local k=k+1;
    #end
    #local e1 = e2;
    #local e2 = k;
    #if (i) stripfaces(s1-1, e1-1, s2-1, e2-1) #end
    #local i=i+1;
  #end

  echo("\nNum Verts *****************")
  echof(NumVertices)

  echo("\nNum Edges *****************")
  echof(NumEdges)
  echof(NumEdges)
#end

#macro stripfaces(s1, e1, s2, e2)
//(range1 range2)
  #local n1 = (e1-s1) + 1;
  #local n2 = (e2-s2) + 1;


  #local j = s2;
  #local i = s1;
  //echo("stripping edges")

   #while (j < e2)

     #declare Edge_Arr[NumEdges] = <j,j+1>;
     #declare NumEdges = NumEdges+1;
     #local j = j+1;
   #end
   #if (e2 != s2)
     #declare Edge_Arr[NumEdges] = <e2,s2>;
     #declare NumEdges = NumEdges+1;
   #end

   #if (n1 <= n2)
     #local i = s1;
     #local j = s2;
     #local k = i;
     #local aratio = n1 / n2;
     #local h = 0;

     #while (h < n1+n2)

       #if (NumEdges < NumVertices*4)
         #declare Edge_Arr[NumEdges] = <i,j>;
         #declare NumEdges = NumEdges+1;
       #end

       #if (floor(k+aratio) = i)
         #if ((j+1) <= e2) #local j=j+1; #local k = k+aratio;  #end
       #else
         #if ((i+1) <= e1) #local i = i+1; #end
       #end

       #local h = h+1;
     #end // while

     #if (NumEdges < NumVertices*4)
      #declare Edge_Arr[NumEdges] = <s1,e2>;
      #declare NumEdges = NumEdges+1;
     #end


   #else

     #local i = s2;
     #local j = s1;
     #local k = i;


     #local aratio = n2 / n1;
     #local h = 0;

     #while (h < n1+n2)

       #if (NumEdges < NumVertices*4)
         #declare Edge_Arr[NumEdges] = <i,j>;
         #declare NumEdges = NumEdges+1;
       #end

       #if (floor(k+aratio) = i)
         #if ((j+1) <= e1) #local j=j+1; #local k = k+aratio;  #end
       #else
         #if ((i+1) <= e2) #local i = i+1; #end
       #end

       #local h = h+1;
     #end // while

     #if (NumEdges < NumVertices*4)
      #declare Edge_Arr[NumEdges] = <s2,e1>;
      #declare NumEdges = NumEdges+1;
     #end


   #end
#end
#macro numverts(stacks, slices)
//
  #local i = 0;
  #local j = 0;

  #local k = 0;
  #local drho = pi / stacks;
  #local dtheta = pi*2 / slices;
  #while (i <= stacks)
    #local rho = i * drho;
    #local s = sin(rho);
    #local c = cos(rho);
    #local j = 0;
    #if (floor(slices * s) > 1) #local n = floor(slices * s);
    #else #local n = 1; #end

    #local dtheta = pi*2 / n;
    #while (j < n)
      #local theta = j * dtheta;
      #local j=j+1;
      #local k=k+1;
   #end
    #local i=i+1;
  #end
  (k)
#end


((((((((((((((( #include  echo2.inc )))))))))))))

#macro echo(Str)
    #if (1)
        #debug Str
    #end
#end
#macro echof(f)
echo(concat("\n ",str(f,2,5)))
#end
#macro echov(V)
echo(concat("\n<",str(V.x,2,5),",",str(V.y,2,5),",",str(V.z,2,5),">"))
#end
#macro echov2(V)
echo(concat("\n<",str(V.x,2,5),",",str(V.y,2,5),">"))
#end


Post a reply to this message


Attachments:
Download 'segment4.png' (291 KB)

Preview of image 'segment4.png'
segment4.png


 

From: alphaQuad
Subject: Re: Easter People will dig this one
Date: 10 Mar 2008 15:30:00
Message: <web.47d59a1d306ecca6f12d29b40@news.povray.org>
just vertspheres


Post a reply to this message


Attachments:
Download 'egg.png' (394 KB)

Preview of image 'egg.png'
egg.png


 

From: Mike the Elder
Subject: Re: Easter People will dig this one
Date: 10 Mar 2008 16:00:00
Message: <web.47d5a095306ecca65a8888d90@news.povray.org>
"alphaQuad" <alp### [at] earthlinknet> wrote:
> or is it a spaceship...
>
I'm not an "Eater Person" per se (although I did once go to a really good party
on Friday night and wake up on Sunday afternoon with a sheet pulled over my
head), but I do "dig" it.

Perhaps this could be the start of a "creative egg" thread that could run until
Easter.

..... I suppose I should do one now ;-)

Best Regards,
Mike C.


Post a reply to this message

From: St 
Subject: Re: Easter People will dig this one
Date: 10 Mar 2008 16:28:31
Message: <47d5a7ff$1@news.povray.org>
> just vertspheres


    grapes


Post a reply to this message

From: alphaQuad
Subject: Re: Easter People will dig this one
Date: 10 Mar 2008 16:40:01
Message: <web.47d5aa1c306ecca6f12d29b40@news.povray.org>
One more, 'til I dream up a new option.
spheroid(1.4, 0.0, 0.2, 0.2, 10, 16)

Regards,
aQ


Post a reply to this message


Attachments:
Download 'segment3.png' (301 KB)

Preview of image 'segment3.png'
segment3.png


 

From: alphaQuad
Subject: Re: Easter People will dig this one
Date: 10 Mar 2008 21:35:00
Message: <web.47d5eefe306ecca6eb11fb6e0@news.povray.org>
Its Like I put on this mask and couldnt be stopped. Somebody Stop me.

No wait, someone made that movie already.

Can't stop playing with it.


Post a reply to this message


Attachments:
Download 'segment5.png' (268 KB)

Preview of image 'segment5.png'
segment5.png


 

From: alphaQuad
Subject: Re: Easter People will dig this one
Date: 11 Mar 2008 00:35:00
Message: <web.47d6191b306ecca6eb11fb6e0@news.povray.org>
"Mike the Elder" <nomail@nomail> wrote:

> ..... I suppose I should do one now ;-)
>
> Best Regards,
> Mike C.

Yes you should!

Academic question:

While your on it, ponder if all points can connect 6 edges, as opposed to what
segment3.png shows; points connecting 5, 6, and 7 edges.

Wondering if mathematical magic can do it, or if my design depends on limited
num stacks/slices, or if it is even possible. Seems a structural weakness and
design flaw where 7 edges connect with adjacent 5-edge connections.

aQ


Post a reply to this message

From: Jan Dvorak
Subject: Re: Easter People will dig this one
Date: 11 Mar 2008 01:32:06
Message: <47d62766$1@news.povray.org>
alphaQuad napsal(a):
> "Mike the Elder" <nomail@nomail> wrote:
> 
>> ..... I suppose I should do one now ;-)
>>
>> Best Regards,
>> Mike C.
> 
> Yes you should!
> 
> Academic question:
> 
> While your on it, ponder if all points can connect 6 edges, as opposed to what
> segment3.png shows; points connecting 5, 6, and 7 edges.
> 
> Wondering if mathematical magic can do it, or if my design depends on limited
> num stacks/slices, or if it is even possible. Seems a structural weakness and
> design flaw where 7 edges connect with adjacent 5-edge connections.
> 
> aQ
> 
no. You need vertices (points) of order 5. Assuming you only want to use 
vertices of order 5 and 6, you need 12 5-order vertices as in the 
icosahedron, or 6 4-order vertices, or 4 3-order vertices.
It follows from the Euler's characteristic:
	V+F=E+2
V-number of vertices
F-number of faces
E-number of edges
2-euler's characteristic of the sphere
if we assume no double edges(diangular faces) we can write E >= 3/2 F.
establishing F <= 2/3 E into the previous formula we get:
V + 2/3 E >= E + 2
V - 2 >= 1/3 E
6V - 12 >= 2 E
If you definitely want no 5-order vertices you can still use toroidal 
domes (V+F=E+0) instead of spherical ones. or you can use partial spheres.
-- 
You know you've been raytracing too long when...
you ever saw a beautiful scenerey and regretted not to take your 6" 
reflective ball and a digital camera, thinking "this would have been a 
perfect light probe"
-Johnny D


Post a reply to this message

From: alphaQuad
Subject: Re: Easter People will dig this one
Date: 11 Mar 2008 12:05:00
Message: <web.47d6bb69c8182436828155c30@news.povray.org>
Jan Dvorak <jan### [at] centrumcz> wrote:

> if we assume no double edges(diangular faces)

.... or triple.

previous code patch:

stripfaces()

#while (h < n1+n2-1)
#while (h < n1+n2-1)

#if (n1 > 1) Edge_Arr[NumEdges] = <s1,e2>; ...
#if (n2 > 1) Edge_Arr[NumEdges] = <s2,e1>; ...
replaces
//#if (NumEdges < NumVertices*4)
//#if (NumEdges < NumVertices*4)

for last edge, where range1==1 or range2==1 then done, no quad left to disect

Some known method can check accuracy:
320:Verts == 636:Triangles == 954:Edges == 16:Stacks/32:Slices

so now
#declare Edge_Arr=array[NumVertices*3]
should always be enough
Versus:
#declare Edge_Arr=array[NumVertices*4]

(I was over 972-954 edges)


Post a reply to this message


Attachments:
Download 'segment6.png' (437 KB)

Preview of image 'segment6.png'
segment6.png


 

From: alphaQuad
Subject: Re: Easter People will dig this one
Date: 12 Mar 2008 09:20:01
Message: <web.47d7e627c8182436ec9d54140@news.povray.org>
finished the UV Norm and Face arrays for a mesh2 surface.

I'll post the rest if anyone is interested.

320:Verts = 954:Edges = 634:faces if all calcs are right now.


Post a reply to this message


Attachments:
Download 'egg2.jpg' (246 KB)

Preview of image 'egg2.jpg'
egg2.jpg


 

Goto Latest 10 Messages Next 10 Messages >>>

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