Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/Tetrahedron+with+tclogl?V=12
QUERY_STRINGV=12
CONTENT_TYPE
DOCUMENT_URI/revision/Tetrahedron+with+tclogl
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.71.254.217
REMOTE_PORT57474
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.149.229.253
HTTP_CF_RAY876f253aac37233f-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.149.229.253
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {Tetrahedron with tclogl} \[Paul\ Obermeier\]\ 2005/07/27\n\nThe\ Sierpinski\ demo\ implemented\ with\ \[tclogl\].\n\nTclOgl\ has\ been\ enhanced\ and\ renamed\ to\ \[Tcl3D\].\n\nThis\ is\ a\ slightly\ modified\ version\ of\ \[Tetrahedron\ with\ 3dcanvas\],\ but\ instead\ of\ using\ the\ \[3dcanvas\]\ package,\ it\ uses\ hardware\ accelerated\ OpenGL\ calls.\n\nSee\ also\ \[Optimized\ Tetrahedron\ with\ tclogl\].\n\nAn\ updated\ version\ (including\ the\ optimizations\ mentioned\ above)\ is\ available\ as\ part\ of\ the\ \[Tcl3D\]\ demos\ at\ \[http://www.tcl3d.org/cgi-bin/demolist.tcl?dir=LibrarySpecificDemos/tcl3dOgl\].\n\n----\n\[http://www.poSoft.de/images/sierpinski3.png\]\n\[http://www.poSoft.de/images/sierpinski8.png\]\n----\n\ #!/bin/sh\n\ #\ The\ next\ line\ restarts\ using\ wish84\ \\\n\ exec\ wish8.4\ \$0\ \$\{1+\"\$@\"\}\n\ \n\ #\ tetra-3dc.tcl\n\ #\ Author:\ Gerard\ Sookahet\n\ #\ Date:\ 2004-06-18\n\ #\ Description:\ 3D\ Sierpinski\ Tetrahedron\ with\ 3dcanvas\n\ \n\ #\ Modified\ to\ use\ OpenGL\ (package\ tclogl)\n\ #\ Author:\ Paul\ Obermeier\n\ #\ Date:\ 2005-06-27\n\ \n\ package\ require\ Tk\n\ package\ require\ tclogl\n\ package\ require\ Togl\n\ \n\ catch\ \{\ console\ show\ \}\n\ \n\ bind\ all\ <Escape>\ \{\ exit\ \}\n\ \n\ proc\ About\ \{\}\ \{\n\ \ \ \ \ set\ w\ .about\n\ \ \ \ \ catch\ \{destroy\ \$w\}\ \;\ toplevel\ \$w\n\ \ \ \ \ wm\ title\ \$w\ \"About\ this\ demo\"\n\ \ \ \ \ message\ \$w.msg\ -justify\ center\ -aspect\ 250\ -relief\ sunken\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ -text\ \"tclogl\ demo:\ Sierpinski\ Tetrahedron\\n\\nGerard\ Sookahet,\ June\ 2004\\n\\nPaul\ Obermeier,\ June\ 2005\"\n\ \ \ \ \ button\ \$w.bquit\ -text\ OK\ -command\ \{destroy\ .about\}\n\ \ \ \ \ eval\ pack\ \[winfo\ children\ \$w\]\n\ \}\n\ \n\ proc\ rotX\ \{\ w\ angle\ \}\ \{\n\ \ \ \ \ set\ ::xRotate\ \[expr\ \$::xRotate\ +\ \$angle\]\n\ \ \ \ \ \$w\ postredisplay\n\ \}\n\ \n\ proc\ rotY\ \{\ w\ angle\ \}\ \{\n\ \ \ \ \ set\ ::yRotate\ \[expr\ \$::yRotate\ +\ \$angle\]\n\ \ \ \ \ \$w\ postredisplay\n\ \}\n\ \n\ proc\ rotZ\ \{\ w\ angle\ \}\ \{\n\ \ \ \ \ set\ ::zRotate\ \[expr\ \$::zRotate\ +\ \$angle\]\n\ \ \ \ \ \$w\ postredisplay\n\ \}\n\ \n\ #\ Animation\ loop\n\ proc\ Animate\ \{\ w\ \}\ \{\n\ \ \ \ \ rotY\ \$w\ 3\n\ \ \ \ \ rotZ\ \$w\ 3\n\ \ \ \ \ after\ 32\ Animate\ \$w\n\ \}\n\ \n\ proc\ Sierpinski\ \{\ w\ level\ l\ \}\ \{\n\ \ \ \ \ global\ rdepth\n\ \n\ \ \ \ \ if\ \{\$level\ >\ \$rdepth\}\ then\ return\n\ \ \ \ \ set\ i\ 1\n\ \ \ \ \ foreach\ \{x\ y\ z\}\ \$l\ \{\n\ \ \ \ \ \ \ \ \ set\ p(\$i)\ \"\$x\ \$y\ \$z\"\n\ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \}\n\ \ \ \ \ set\ p12\ \[MidPoint\ \[concat\ \$p(1)\ \$p(2)\]\]\n\ \ \ \ \ set\ p13\ \[MidPoint\ \[concat\ \$p(1)\ \$p(3)\]\]\n\ \ \ \ \ set\ p14\ \[MidPoint\ \[concat\ \$p(1)\ \$p(4)\]\]\n\ \ \ \ \ set\ p23\ \[MidPoint\ \[concat\ \$p(2)\ \$p(3)\]\]\n\ \ \ \ \ set\ p24\ \[MidPoint\ \[concat\ \$p(2)\ \$p(4)\]\]\n\ \ \ \ \ set\ p34\ \[MidPoint\ \[concat\ \$p(3)\ \$p(4)\]\]\n\ \ \ \ \ incr\ level\n\ \ \ \ \ if\ \{\$level\ ==\ \$rdepth\}\ then\ \{\n\ \ \ \ \ \ \ \ \ DrawTetra\ \$w\ \[concat\ \$p(1)\ \$p(2)\ \$p(3)\ \$p(4)\]\n\ \ \ \ \ \}\n\ \ \ \ \ Sierpinski\ \$w\ \$level\ \[concat\ \$p(1)\ \$p12\ \$p13\ \$p14\]\n\ \ \ \ \ Sierpinski\ \$w\ \$level\ \[concat\ \$p(2)\ \$p12\ \$p23\ \$p24\]\n\ \ \ \ \ Sierpinski\ \$w\ \$level\ \[concat\ \$p(3)\ \$p13\ \$p23\ \$p34\]\n\ \ \ \ \ Sierpinski\ \$w\ \$level\ \[concat\ \$p(4)\ \$p14\ \$p24\ \$p34\]\n\ \}\n\ \n\ proc\ DrawTetra\ \{\ w\ l\ \}\ \{\n\ \ \ \ \ #puts\ \"DrawTetra\ \$l\"\n\ \ \ \ \ set\ i\ 1\n\ \ \ \ \ foreach\ \{x\ y\ z\}\ \$l\ \{\n\ \ \ \ \ \ \ \ \ set\ p(\$i)\ \[list\ \$x\ \$y\ \$z\]\n\ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \}\n\ \ \ \ \ glBegin\ GL_TRIANGLES\n\ \ \ \ \ \ \ \ \ glColor3f\ 1\ 0\ 0\ \;\ #\ RED\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(1)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(2)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(3)\n\ \n\ \ \ \ \ \ \ \ \ glColor3f\ 1\ 1\ 0\ \;\ #\ YELLOW\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(2)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(3)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(4)\n\ \n\ \ \ \ \ \ \ \ \ glColor3f\ 0\ 0\ 1\ \;\ #\ BLUE\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(1)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(3)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(4)\n\ \n\ \ \ \ \ \ \ \ \ glColor3f\ 0\ 1\ 0\ \;\ #\ GREEN\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(1)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(2)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(4)\n\ \ \ \ \ glEnd\n\ \ \ \ \ incr\ ::numTrias\ 4\n\ \}\n\ \n\ #\ Return\ the\ middle\ coordinates\ of\ two\ 3d\ points\n\ proc\ MidPoint\ \{\ l\ \}\ \{\n\ \ \ \ \ set\ X\ 0\n\ \ \ \ \ set\ Y\ 0\n\ \ \ \ \ set\ Z\ 0\n\ \ \ \ \ foreach\ \{x\ y\ z\}\ \$l\ \{\n\ \ \ \ \ \ \ \ \ set\ X\ \[expr\ \{\$X\ +\ \$x\}\]\n\ \ \ \ \ \ \ \ \ set\ Y\ \[expr\ \{\$Y\ +\ \$y\}\]\n\ \ \ \ \ \ \ \ \ set\ Z\ \[expr\ \{\$Z\ +\ \$z\}\]\n\ \ \ \ \ \}\n\ \ \ \ \ return\ \[list\ \[expr\ \{\$X/2\}\]\ \[expr\ \{\$Y/2\}\]\ \[expr\ \{\$Z/2\}\]\]\n\ \}\n\ \n\ proc\ Init\ \{\ w\ \}\ \{\n\ \ \ \ \ set\ edge\ 340\n\ \ \ \ \ set\ x1\ \[expr\ \{sqrt(3)*\$edge/3\}\]\n\ \ \ \ \ set\ x2\ \[expr\ \{sqrt(3)*\$edge/6\}\]\n\ \ \ \ \ set\ z3\ \[expr\ \{sqrt(6)*\$edge/3\}\]\n\ \ \ \ \ set\ y2\ \[expr\ \{\$edge/2\}\]\n\ \ \ \ \ #\ Vertices'\ coordinates\ of\ the\ regular\ tetrahedron\n\ \ \ \ \ set\ p1\ \"\$x1\ 0\ 0\"\n\ \ \ \ \ set\ p2\ \"-\$x2\ \$y2\ 0\"\n\ \ \ \ \ set\ p3\ \"-\$x2\ -\$y2\ 0\"\n\ \ \ \ \ set\ p4\ \"0\ 0\ \$z3\"\n\ \n\ \ \ \ \ if\ \{\ \[info\ exists\ ::sierList\]\ \}\ \{\n\ \ \ \ \ \ \ \ \ glDeleteLists\ \$::sierList\ 1\n\ \ \ \ \ \}\n\ \ \ \ \ set\ ::sierList\ \[glGenLists\ 1\]\n\ \ \ \ \ glNewList\ \$::sierList\ GL_COMPILE\n\ \ \ \ \ set\ ::numTrias\ 0\n\ \ \ \ \ Sierpinski\ \$w\ 0\ \[concat\ \$p1\ \$p2\ \$p3\ \$p4\]\n\ \ \ \ \ puts\ \"Number\ of\ triangles:\ \$::numTrias\"\n\ \ \ \ \ glEndList\n\ \}\n\ \n\ proc\ tclCreateFunc\ \{\ w\ \}\ \{\n\ \ \ \ \ glClearColor\ 0\ 0\ 0\ 0\n\ \ \ \ \ glEnable\ GL_DEPTH_TEST\n\ \ \ \ \ glShadeModel\ GL_FLAT\n\ \ \ \ \ Init\ \$w\n\ \}\n\ \n\ proc\ tclDisplayFunc\ \{\ w\ \}\ \{\n\ \ \ \ \ glClear\ \[expr\ \$::GL_COLOR_BUFFER_BIT\ |\ \$::GL_DEPTH_BUFFER_BIT\]\n\ \ \ \ \ glPushMatrix\n\ \ \ \ \ glTranslatef\ 0\ 0\ \[expr\ -1.0\ *\ \$::vdist\]\n\ \ \ \ \ glRotatef\ \$::xRotate\ 1.0\ 0.0\ 0.0\n\ \ \ \ \ glRotatef\ \$::yRotate\ 0.0\ 1.0\ 0.0\n\ \ \ \ \ glRotatef\ \$::zRotate\ 0.0\ 0.0\ 1.0\n\ \ \ \ \ glCallList\ \$::sierList\n\ \ \ \ \ glPopMatrix\n\ \ \ \ \ \$w\ swapbuffers\n\ \}\n\ \n\ proc\ tclReshapeFunc\ \{\ toglwin\ w\ h\ \}\ \{\n\ \ \ \ \ glViewport\ 0\ 0\ \$w\ \$h\n\ \ \ \ \ glMatrixMode\ GL_PROJECTION\n\ \ \ \ \ glLoadIdentity\n\ \ \ \ \ gluPerspective\ 60.0\ \[expr\ double(\$w)/double(\$h)\]\ 1.0\ 2000.0\n\ \ \ \ \ glMatrixMode\ GL_MODELVIEW\n\ \ \ \ \ glLoadIdentity\n\ \ \ \ \ gluLookAt\ 0.0\ 0.0\ 5.0\ 0.0\ 0.0\ 0.0\ 0.0\ 1.0\ 0.0\n\ \}\n\ \n\ set\ vdist\ 400\n\ set\ rdepth\ 1\n\ set\ xRotate\ 0.0\n\ set\ yRotate\ 0.0\n\ set\ zRotate\ 0.0\n\ \ \n\ wm\ title\ .\ \"Sierpinski\ Tetrahedron\"\n\ togl\ .c\ -width\ 500\ -height\ 500\ \\\n\ \ \ \ \ \ \ \ \ -double\ true\ -depth\ true\ \\\n\ \ \ \ \ \ \ \ \ -displayproc\ tclDisplayFunc\ \\\n\ \ \ \ \ \ \ \ \ -reshapeproc\ tclReshapeFunc\ \\\n\ \ \ \ \ \ \ \ \ -createproc\ \ tclCreateFunc\n\ pack\ .c\ -side\ top\n\ \n\ set\ f1\ \[frame\ .f1\]\n\ label\ \$f1.l1\ -text\ \"Recursive\ depth\ \"\n\ spinbox\ \$f1.sdepth\ -from\ 1\ -to\ 10\ -textvariable\ rdepth\ -width\ 4\n\ label\ \$f1.l2\ -text\ \"\ \ \ View\ distance\ \"\n\ scale\ \$f1.vd\ -from\ 0\ -to\ 1000\ -length\ 200\ -orient\ horiz\ -showvalue\ true\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -variable\ vdist\ -command\ \{.c\ postredisplay\}\n\ eval\ pack\ \[winfo\ children\ \$f1\]\ -side\ left\n\ pack\ \$f1\n\ set\ f2\ \[frame\ .f2\]\n\ button\ \$f2.brun\ -text\ \"Run\"\ -width\ 10\ -fg\ white\ -bg\ blue\ -command\ \{Init\ .c\}\n\ button\ \$f2.bromega\ -text\ \"Z\ rotate\"\ -width\ 10\ -command\ \{rotZ\ .c\ 8\}\n\ button\ \$f2.brphi\ \ \ -text\ \"Y\ rotate\"\ -width\ 10\ -command\ \{rotY\ .c\ 8\}\n\ button\ \$f2.brtheta\ -text\ \"X\ rotate\"\ -width\ 10\ -command\ \{rotX\ .c\ 8\}\n\ button\ \$f2.banim\ -text\ Animate\ -width\ 10\ -command\ \{Animate\ .c\}\n\ button\ \$f2.babout\ -text\ A\ -width\ 1\ -bg\ grey\ -command\ \{About\}\n\ button\ \$f2.bquit\ -text\ Quit\ -width\ 10\ -bg\ grey\ -command\ exit\n\ eval\ pack\ \[winfo\ children\ \$f2\]\ -side\ left\n\ pack\ \$f2\n\ \n\ proc\ handleRot\ \{x\ y\ win\}\ \{\n\ \ \ \ \ global\ cx\ cy\n\ \n\ \ \ \ \ rotY\ \$win\ \[expr\ \{180\ *\ (double(\$x\ -\ \$cx)\ /\ \[winfo\ width\ \$win\])\}\]\n\ \ \ \ \ rotX\ \$win\ \[expr\ \{180\ *\ (double(\$y\ -\ \$cy)\ /\ \[winfo\ height\ \$win\])\}\]\n\ \n\ \ \ \ \ set\ cx\ \$x\n\ \ \ \ \ set\ cy\ \$y\n\ \}\n\ \n\ bind\ .c\ <1>\ \{set\ cx\ %x\;\ set\ cy\ %y\}\n\ bind\ .c\ <B1-Motion>\ \{handleRot\ %x\ %y\ %W\}\n----\nThis\ is\ wrong:\ \ \nscale\ \$f1.vd\ -from\ 0\ -to\ 1000\ -length\ 200\ -orient\ horiz\ -showvalue\ true\ -variable\ vdist\ -command\ \{.c\ postredisplay\}\n\"scale\"\ passed\ in\ parameter\ to\ \".c\ postredisplay\ <value>\"\ and\ it\ doesn't\ like\ that.\n\nAlso,\ tclReshapeFunc\ callback\ passed\ in\ only\ one\ value.\ \ So\ it\ has\ to\ be\n======c\nproc\ tclReshapeFunc\ \{\ toglwin\ \{\ w\ -1\ \}\ \{\ h\ -1\ \}\ \}\ \{\n\ \ \ \ set\ w\ \[\$toglwin\ width\]\n\ \ \ \ set\ h\ \[\$toglwin\ height\]\n=====\n<<categories>>\ Category\ Graphics|Category\ 3D\ Graphics|Category\ Tcl3D regexp2} CALL {my render {Tetrahedron with tclogl} \[Paul\ Obermeier\]\ 2005/07/27\n\nThe\ Sierpinski\ demo\ implemented\ with\ \[tclogl\].\n\nTclOgl\ has\ been\ enhanced\ and\ renamed\ to\ \[Tcl3D\].\n\nThis\ is\ a\ slightly\ modified\ version\ of\ \[Tetrahedron\ with\ 3dcanvas\],\ but\ instead\ of\ using\ the\ \[3dcanvas\]\ package,\ it\ uses\ hardware\ accelerated\ OpenGL\ calls.\n\nSee\ also\ \[Optimized\ Tetrahedron\ with\ tclogl\].\n\nAn\ updated\ version\ (including\ the\ optimizations\ mentioned\ above)\ is\ available\ as\ part\ of\ the\ \[Tcl3D\]\ demos\ at\ \[http://www.tcl3d.org/cgi-bin/demolist.tcl?dir=LibrarySpecificDemos/tcl3dOgl\].\n\n----\n\[http://www.poSoft.de/images/sierpinski3.png\]\n\[http://www.poSoft.de/images/sierpinski8.png\]\n----\n\ #!/bin/sh\n\ #\ The\ next\ line\ restarts\ using\ wish84\ \\\n\ exec\ wish8.4\ \$0\ \$\{1+\"\$@\"\}\n\ \n\ #\ tetra-3dc.tcl\n\ #\ Author:\ Gerard\ Sookahet\n\ #\ Date:\ 2004-06-18\n\ #\ Description:\ 3D\ Sierpinski\ Tetrahedron\ with\ 3dcanvas\n\ \n\ #\ Modified\ to\ use\ OpenGL\ (package\ tclogl)\n\ #\ Author:\ Paul\ Obermeier\n\ #\ Date:\ 2005-06-27\n\ \n\ package\ require\ Tk\n\ package\ require\ tclogl\n\ package\ require\ Togl\n\ \n\ catch\ \{\ console\ show\ \}\n\ \n\ bind\ all\ <Escape>\ \{\ exit\ \}\n\ \n\ proc\ About\ \{\}\ \{\n\ \ \ \ \ set\ w\ .about\n\ \ \ \ \ catch\ \{destroy\ \$w\}\ \;\ toplevel\ \$w\n\ \ \ \ \ wm\ title\ \$w\ \"About\ this\ demo\"\n\ \ \ \ \ message\ \$w.msg\ -justify\ center\ -aspect\ 250\ -relief\ sunken\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ -text\ \"tclogl\ demo:\ Sierpinski\ Tetrahedron\\n\\nGerard\ Sookahet,\ June\ 2004\\n\\nPaul\ Obermeier,\ June\ 2005\"\n\ \ \ \ \ button\ \$w.bquit\ -text\ OK\ -command\ \{destroy\ .about\}\n\ \ \ \ \ eval\ pack\ \[winfo\ children\ \$w\]\n\ \}\n\ \n\ proc\ rotX\ \{\ w\ angle\ \}\ \{\n\ \ \ \ \ set\ ::xRotate\ \[expr\ \$::xRotate\ +\ \$angle\]\n\ \ \ \ \ \$w\ postredisplay\n\ \}\n\ \n\ proc\ rotY\ \{\ w\ angle\ \}\ \{\n\ \ \ \ \ set\ ::yRotate\ \[expr\ \$::yRotate\ +\ \$angle\]\n\ \ \ \ \ \$w\ postredisplay\n\ \}\n\ \n\ proc\ rotZ\ \{\ w\ angle\ \}\ \{\n\ \ \ \ \ set\ ::zRotate\ \[expr\ \$::zRotate\ +\ \$angle\]\n\ \ \ \ \ \$w\ postredisplay\n\ \}\n\ \n\ #\ Animation\ loop\n\ proc\ Animate\ \{\ w\ \}\ \{\n\ \ \ \ \ rotY\ \$w\ 3\n\ \ \ \ \ rotZ\ \$w\ 3\n\ \ \ \ \ after\ 32\ Animate\ \$w\n\ \}\n\ \n\ proc\ Sierpinski\ \{\ w\ level\ l\ \}\ \{\n\ \ \ \ \ global\ rdepth\n\ \n\ \ \ \ \ if\ \{\$level\ >\ \$rdepth\}\ then\ return\n\ \ \ \ \ set\ i\ 1\n\ \ \ \ \ foreach\ \{x\ y\ z\}\ \$l\ \{\n\ \ \ \ \ \ \ \ \ set\ p(\$i)\ \"\$x\ \$y\ \$z\"\n\ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \}\n\ \ \ \ \ set\ p12\ \[MidPoint\ \[concat\ \$p(1)\ \$p(2)\]\]\n\ \ \ \ \ set\ p13\ \[MidPoint\ \[concat\ \$p(1)\ \$p(3)\]\]\n\ \ \ \ \ set\ p14\ \[MidPoint\ \[concat\ \$p(1)\ \$p(4)\]\]\n\ \ \ \ \ set\ p23\ \[MidPoint\ \[concat\ \$p(2)\ \$p(3)\]\]\n\ \ \ \ \ set\ p24\ \[MidPoint\ \[concat\ \$p(2)\ \$p(4)\]\]\n\ \ \ \ \ set\ p34\ \[MidPoint\ \[concat\ \$p(3)\ \$p(4)\]\]\n\ \ \ \ \ incr\ level\n\ \ \ \ \ if\ \{\$level\ ==\ \$rdepth\}\ then\ \{\n\ \ \ \ \ \ \ \ \ DrawTetra\ \$w\ \[concat\ \$p(1)\ \$p(2)\ \$p(3)\ \$p(4)\]\n\ \ \ \ \ \}\n\ \ \ \ \ Sierpinski\ \$w\ \$level\ \[concat\ \$p(1)\ \$p12\ \$p13\ \$p14\]\n\ \ \ \ \ Sierpinski\ \$w\ \$level\ \[concat\ \$p(2)\ \$p12\ \$p23\ \$p24\]\n\ \ \ \ \ Sierpinski\ \$w\ \$level\ \[concat\ \$p(3)\ \$p13\ \$p23\ \$p34\]\n\ \ \ \ \ Sierpinski\ \$w\ \$level\ \[concat\ \$p(4)\ \$p14\ \$p24\ \$p34\]\n\ \}\n\ \n\ proc\ DrawTetra\ \{\ w\ l\ \}\ \{\n\ \ \ \ \ #puts\ \"DrawTetra\ \$l\"\n\ \ \ \ \ set\ i\ 1\n\ \ \ \ \ foreach\ \{x\ y\ z\}\ \$l\ \{\n\ \ \ \ \ \ \ \ \ set\ p(\$i)\ \[list\ \$x\ \$y\ \$z\]\n\ \ \ \ \ \ \ \ \ incr\ i\n\ \ \ \ \ \}\n\ \ \ \ \ glBegin\ GL_TRIANGLES\n\ \ \ \ \ \ \ \ \ glColor3f\ 1\ 0\ 0\ \;\ #\ RED\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(1)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(2)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(3)\n\ \n\ \ \ \ \ \ \ \ \ glColor3f\ 1\ 1\ 0\ \;\ #\ YELLOW\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(2)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(3)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(4)\n\ \n\ \ \ \ \ \ \ \ \ glColor3f\ 0\ 0\ 1\ \;\ #\ BLUE\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(1)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(3)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(4)\n\ \n\ \ \ \ \ \ \ \ \ glColor3f\ 0\ 1\ 0\ \;\ #\ GREEN\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(1)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(2)\n\ \ \ \ \ \ \ \ \ glVertex3fv\ \$p(4)\n\ \ \ \ \ glEnd\n\ \ \ \ \ incr\ ::numTrias\ 4\n\ \}\n\ \n\ #\ Return\ the\ middle\ coordinates\ of\ two\ 3d\ points\n\ proc\ MidPoint\ \{\ l\ \}\ \{\n\ \ \ \ \ set\ X\ 0\n\ \ \ \ \ set\ Y\ 0\n\ \ \ \ \ set\ Z\ 0\n\ \ \ \ \ foreach\ \{x\ y\ z\}\ \$l\ \{\n\ \ \ \ \ \ \ \ \ set\ X\ \[expr\ \{\$X\ +\ \$x\}\]\n\ \ \ \ \ \ \ \ \ set\ Y\ \[expr\ \{\$Y\ +\ \$y\}\]\n\ \ \ \ \ \ \ \ \ set\ Z\ \[expr\ \{\$Z\ +\ \$z\}\]\n\ \ \ \ \ \}\n\ \ \ \ \ return\ \[list\ \[expr\ \{\$X/2\}\]\ \[expr\ \{\$Y/2\}\]\ \[expr\ \{\$Z/2\}\]\]\n\ \}\n\ \n\ proc\ Init\ \{\ w\ \}\ \{\n\ \ \ \ \ set\ edge\ 340\n\ \ \ \ \ set\ x1\ \[expr\ \{sqrt(3)*\$edge/3\}\]\n\ \ \ \ \ set\ x2\ \[expr\ \{sqrt(3)*\$edge/6\}\]\n\ \ \ \ \ set\ z3\ \[expr\ \{sqrt(6)*\$edge/3\}\]\n\ \ \ \ \ set\ y2\ \[expr\ \{\$edge/2\}\]\n\ \ \ \ \ #\ Vertices'\ coordinates\ of\ the\ regular\ tetrahedron\n\ \ \ \ \ set\ p1\ \"\$x1\ 0\ 0\"\n\ \ \ \ \ set\ p2\ \"-\$x2\ \$y2\ 0\"\n\ \ \ \ \ set\ p3\ \"-\$x2\ -\$y2\ 0\"\n\ \ \ \ \ set\ p4\ \"0\ 0\ \$z3\"\n\ \n\ \ \ \ \ if\ \{\ \[info\ exists\ ::sierList\]\ \}\ \{\n\ \ \ \ \ \ \ \ \ glDeleteLists\ \$::sierList\ 1\n\ \ \ \ \ \}\n\ \ \ \ \ set\ ::sierList\ \[glGenLists\ 1\]\n\ \ \ \ \ glNewList\ \$::sierList\ GL_COMPILE\n\ \ \ \ \ set\ ::numTrias\ 0\n\ \ \ \ \ Sierpinski\ \$w\ 0\ \[concat\ \$p1\ \$p2\ \$p3\ \$p4\]\n\ \ \ \ \ puts\ \"Number\ of\ triangles:\ \$::numTrias\"\n\ \ \ \ \ glEndList\n\ \}\n\ \n\ proc\ tclCreateFunc\ \{\ w\ \}\ \{\n\ \ \ \ \ glClearColor\ 0\ 0\ 0\ 0\n\ \ \ \ \ glEnable\ GL_DEPTH_TEST\n\ \ \ \ \ glShadeModel\ GL_FLAT\n\ \ \ \ \ Init\ \$w\n\ \}\n\ \n\ proc\ tclDisplayFunc\ \{\ w\ \}\ \{\n\ \ \ \ \ glClear\ \[expr\ \$::GL_COLOR_BUFFER_BIT\ |\ \$::GL_DEPTH_BUFFER_BIT\]\n\ \ \ \ \ glPushMatrix\n\ \ \ \ \ glTranslatef\ 0\ 0\ \[expr\ -1.0\ *\ \$::vdist\]\n\ \ \ \ \ glRotatef\ \$::xRotate\ 1.0\ 0.0\ 0.0\n\ \ \ \ \ glRotatef\ \$::yRotate\ 0.0\ 1.0\ 0.0\n\ \ \ \ \ glRotatef\ \$::zRotate\ 0.0\ 0.0\ 1.0\n\ \ \ \ \ glCallList\ \$::sierList\n\ \ \ \ \ glPopMatrix\n\ \ \ \ \ \$w\ swapbuffers\n\ \}\n\ \n\ proc\ tclReshapeFunc\ \{\ toglwin\ w\ h\ \}\ \{\n\ \ \ \ \ glViewport\ 0\ 0\ \$w\ \$h\n\ \ \ \ \ glMatrixMode\ GL_PROJECTION\n\ \ \ \ \ glLoadIdentity\n\ \ \ \ \ gluPerspective\ 60.0\ \[expr\ double(\$w)/double(\$h)\]\ 1.0\ 2000.0\n\ \ \ \ \ glMatrixMode\ GL_MODELVIEW\n\ \ \ \ \ glLoadIdentity\n\ \ \ \ \ gluLookAt\ 0.0\ 0.0\ 5.0\ 0.0\ 0.0\ 0.0\ 0.0\ 1.0\ 0.0\n\ \}\n\ \n\ set\ vdist\ 400\n\ set\ rdepth\ 1\n\ set\ xRotate\ 0.0\n\ set\ yRotate\ 0.0\n\ set\ zRotate\ 0.0\n\ \ \n\ wm\ title\ .\ \"Sierpinski\ Tetrahedron\"\n\ togl\ .c\ -width\ 500\ -height\ 500\ \\\n\ \ \ \ \ \ \ \ \ -double\ true\ -depth\ true\ \\\n\ \ \ \ \ \ \ \ \ -displayproc\ tclDisplayFunc\ \\\n\ \ \ \ \ \ \ \ \ -reshapeproc\ tclReshapeFunc\ \\\n\ \ \ \ \ \ \ \ \ -createproc\ \ tclCreateFunc\n\ pack\ .c\ -side\ top\n\ \n\ set\ f1\ \[frame\ .f1\]\n\ label\ \$f1.l1\ -text\ \"Recursive\ depth\ \"\n\ spinbox\ \$f1.sdepth\ -from\ 1\ -to\ 10\ -textvariable\ rdepth\ -width\ 4\n\ label\ \$f1.l2\ -text\ \"\ \ \ View\ distance\ \"\n\ scale\ \$f1.vd\ -from\ 0\ -to\ 1000\ -length\ 200\ -orient\ horiz\ -showvalue\ true\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -variable\ vdist\ -command\ \{.c\ postredisplay\}\n\ eval\ pack\ \[winfo\ children\ \$f1\]\ -side\ left\n\ pack\ \$f1\n\ set\ f2\ \[frame\ .f2\]\n\ button\ \$f2.brun\ -text\ \"Run\"\ -width\ 10\ -fg\ white\ -bg\ blue\ -command\ \{Init\ .c\}\n\ button\ \$f2.bromega\ -text\ \"Z\ rotate\"\ -width\ 10\ -command\ \{rotZ\ .c\ 8\}\n\ button\ \$f2.brphi\ \ \ -text\ \"Y\ rotate\"\ -width\ 10\ -command\ \{rotY\ .c\ 8\}\n\ button\ \$f2.brtheta\ -text\ \"X\ rotate\"\ -width\ 10\ -command\ \{rotX\ .c\ 8\}\n\ button\ \$f2.banim\ -text\ Animate\ -width\ 10\ -command\ \{Animate\ .c\}\n\ button\ \$f2.babout\ -text\ A\ -width\ 1\ -bg\ grey\ -command\ \{About\}\n\ button\ \$f2.bquit\ -text\ Quit\ -width\ 10\ -bg\ grey\ -command\ exit\n\ eval\ pack\ \[winfo\ children\ \$f2\]\ -side\ left\n\ pack\ \$f2\n\ \n\ proc\ handleRot\ \{x\ y\ win\}\ \{\n\ \ \ \ \ global\ cx\ cy\n\ \n\ \ \ \ \ rotY\ \$win\ \[expr\ \{180\ *\ (double(\$x\ -\ \$cx)\ /\ \[winfo\ width\ \$win\])\}\]\n\ \ \ \ \ rotX\ \$win\ \[expr\ \{180\ *\ (double(\$y\ -\ \$cy)\ /\ \[winfo\ height\ \$win\])\}\]\n\ \n\ \ \ \ \ set\ cx\ \$x\n\ \ \ \ \ set\ cy\ \$y\n\ \}\n\ \n\ bind\ .c\ <1>\ \{set\ cx\ %x\;\ set\ cy\ %y\}\n\ bind\ .c\ <B1-Motion>\ \{handleRot\ %x\ %y\ %W\}\n----\nThis\ is\ wrong:\ \ \nscale\ \$f1.vd\ -from\ 0\ -to\ 1000\ -length\ 200\ -orient\ horiz\ -showvalue\ true\ -variable\ vdist\ -command\ \{.c\ postredisplay\}\n\"scale\"\ passed\ in\ parameter\ to\ \".c\ postredisplay\ <value>\"\ and\ it\ doesn't\ like\ that.\n\nAlso,\ tclReshapeFunc\ callback\ passed\ in\ only\ one\ value.\ \ So\ it\ has\ to\ be\n======c\nproc\ tclReshapeFunc\ \{\ toglwin\ \{\ w\ -1\ \}\ \{\ h\ -1\ \}\ \}\ \{\n\ \ \ \ set\ w\ \[\$toglwin\ width\]\n\ \ \ \ set\ h\ \[\$toglwin\ height\]\n=====\n<<categories>>\ Category\ Graphics|Category\ 3D\ Graphics|Category\ Tcl3D} CALL {my revision {Tetrahedron with tclogl}} CALL {::oo::Obj3984592 process revision/Tetrahedron+with+tclogl} CALL {::oo::Obj3984590 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4