K3DSurf to Eureka 2.12

 
Post new topic   Reply to topic    K3DSurf forum Forum Index -> K3DSurf for MacOS
View previous topic :: View next topic  
Author Message
François LE COAT



Joined: 03 Feb 2007
Posts: 28
Location: France

PostPosted: Sun May 29, 2011 3:50 pm    Post subject: K3DSurf to Eureka 2.12 Reply with quote

Hi,

If one of yours is interested in 3D, and knows K3DSurf like me

http://k3dsurf.sf.net/

you may have noticed the following K3DSurf forum discussion at http://k3dsurf.s4.bizhat.com/viewtopic.php?t=145

A K3DSurf user asks how he would describe the "Snail" surface http://www.3d-meier.de/tut3/Seite38.html and the author replies him (in English) how to do so.


With Eureka 2.12, in order to describe the "Snail Surface" you just have to load the hereafter formula, which is the equivalent Parametric 3D Polar (rho,theta) surface

Code:
<CUT "snail.fmu">
Do not put more than 65 characters per line of formula !
"r*cos(t)*sin(r)"
""
"r*cos(t)*cos(r)"
""
"-r*sin(t)"
""
"K3DSurf formula"
""
""
""
""
""
_____________________ Optional ______________________
"0 2*pi"
"-pi pi"
""
"-10 10"
"-10 10"
"-10 10"
"44 11 5"
</CUT>


and you will obtain the following POV-Ray script exporting

Code:
<CUT "snail.pov">
// File exported by Eureka 2.12. Designed by Archimedium 2007
#version 3.1;
#declare Gold_Phong = texture {
pigment { color rgb <1.0,0.90,0.6> }
finish { phong 1.0 phong_size 5.0 }
}

#declare EPSILON = 1e-10;
#declare xmin  = 0;
#declare xmax  = 6.28318530717958648;
#declare ymin  = -3.14159265358979324;
#declare ymax  = 3.14159265358979324;
#declare xiter = 31;
#declare yiter = 61;
#declare ix    = (xmax-xmin)/(xiter-1.0);
#declare iy    = (ymax-ymin)/(yiter-1.0);
#declare deltax = (xmax-xmin)/((xiter-1.0)*4.0);
#declare deltay = (ymax-ymin)/((yiter-1.0)*4.0);
#macro Point(_,yy)
#local R  = _;
#local T  = yy;
#local U  = 0;
#local X  = R*cos(T);
#local Y  = R*sin(T);
#local absc  = R*cos(T)*sin(R);
#local ordo  = R*cos(T)*cos(R);
#local cote  = -R*sin(T);
    #declare zzz=-absc;
  #declare _=ordo;
  #declare yyy=cote;
#end
#macro Surface(_,yy)
  Point(_,yy)
  #local xn=_;
  #local yn=yyy;
  #local zn=zzz;
  #declare _=_+deltax;
  Point(_,yy)
  #local xp=_;
  #local yp=yyy;
  #local zp=zzz;
  #declare _=_-deltax;
  #declare yy=yy+deltay;
  Point(_,yy)
  #local xq=_;
  #local yq=yyy;
  #local zq=zzz;
  #declare yy=yy-deltay;
  #local vn=vcross(<xp-xn,yp-yn,zp-zn>,<xq-xn,yq-yn,zq-zn>);
  #if(!(vn.x=0&vn.y=0&vn.z=0))
  #declare nn=vnormalize(vn);
  #else
  #declare nn=<1,0,0>;
  #end
  #declare pp=<xn,yn,zn>;
#end
#declare eureka_eureka = mesh {
  #declare _ = xmin;
#while (_<xmax)                        //outer loop
  #declare yy = ymin;
  #while (yy<ymax)                      //inner loop
//POINTS
  Surface(_,yy)
  #declare n1=nn;
  #declare p1=pp;

  #declare yy=yy+iy;
  Surface(_,yy)
  #declare n2=nn;
  #declare p2=pp;

  #declare _=_+ix;
  Surface(_,yy)
  #declare n3=nn;
  #declare p3=pp;

  #declare yy=yy-iy;
  Surface(_,yy)
  #declare n4=nn;
  #declare p4=pp;

  #declare _=_-ix;
#if(!(p1.x=p2.x&p1.y=p2.y&p1.z=p2.z)|(p2.x=p3.x&p2.y=p3.y&p2.z=p3.z)|(p1.x=p3.x&p1.y=p3.y&p1.z=p3.z))
      smooth_triangle {
        p1,n1,
        p2,n2,
        p3,n3
       }

#end
#if(!(p1.x=p3.x&p1.y=p3.y&p1.z=p3.z)|(p3.x=p4.x&p3.y=p4.y&p3.z=p4.z)|(p1.x=p4.x&p1.y=p4.y&p1.z=p4.z))
      smooth_triangle{
        p1,n1,
        p3,n3,
        p4,n4
       }
#end

    #declare yy = yy+iy;
 #end                 //inner loop
 #declare _ = _+ix;
#end                   //outer loop
    translate <0,0,0>
    scale 1.0/12.566370614
}

object {
    eureka_eureka
 no_shadow
texture { Gold_Phong }
rotate <0,36*clock,0>
}

//Lights, camera, action
camera
{ location  < 0.8, 0.8, -0.8>
direction  1*z
look_at   < 0, 0, 0>
}

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

object { box{-2,2 inverse} pigment{color rgb 0.9} }
</CUT>


You may then render this surface with a POV-Ray 36 images animation, and clock (time in POV-Ray) varying in [0 to 5.0] time range.

You will obtain a kind of helix rotating around its axis like

http://eureka.atari.org/snail.gif

You may display it with zView with an ATARI, like that screenshot

http://eureka.atari.org/snail.jpg

Have you launched your ATARI and Eureka 2.12, today ?

ATARIstically yours Smile
_________________
-- archimedium
http://eureka.atari.org/
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    K3DSurf forum Forum Index -> K3DSurf for MacOS All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


2005 Powered by phpBB © 2001, 2005 phpBB Group


Start Your Own Video Sharing Site

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com