aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testrelief.tcl
diff options
context:
space:
mode:
authorlecoanet2000-03-07 13:16:09 +0000
committerlecoanet2000-03-07 13:16:09 +0000
commitf6018b2e4b184a2ec9eca7bbd3e2532cc4ed17ed (patch)
tree92e9d68cd779fab2e6579b20ac574f2cef6ae557 /sandbox/testrelief.tcl
parent3f47be9fe5d3006927c79eb156cfbed946243e26 (diff)
downloadtkzinc-f6018b2e4b184a2ec9eca7bbd3e2532cc4ed17ed.zip
tkzinc-f6018b2e4b184a2ec9eca7bbd3e2532cc4ed17ed.tar.gz
tkzinc-f6018b2e4b184a2ec9eca7bbd3e2532cc4ed17ed.tar.bz2
tkzinc-f6018b2e4b184a2ec9eca7bbd3e2532cc4ed17ed.tar.xz
*** empty log message ***
Diffstat (limited to 'sandbox/testrelief.tcl')
-rw-r--r--sandbox/testrelief.tcl45
1 files changed, 45 insertions, 0 deletions
diff --git a/sandbox/testrelief.tcl b/sandbox/testrelief.tcl
new file mode 100644
index 0000000..be28d8f
--- /dev/null
+++ b/sandbox/testrelief.tcl
@@ -0,0 +1,45 @@
+#!/usr/bin/wish -f
+
+load tkzinc3.1.so
+
+set top 1
+set lw 8
+
+set r [zinc .r -backcolor gray -relief sunken -lightangle 155]
+pack .r -expand t -fill both
+.r configure -width 1024 -height 800
+.r scale $top 1 -1
+
+set view [.r add group $top -tags controls]
+
+proc polypoints { ox oy rad n startangle } {
+ set step [expr 2 * 3.14159 / $n]
+ set startangle [expr $startangle*3.14159/180]
+ set coords ""
+ for {set i 0} {$i < $n} {incr i} {
+ set x [expr $ox + ($rad * cos($i * $step + $startangle))];
+ set y [expr $oy + ($rad * sin($i * $step + $startangle))];
+ lappend coords $x $y;
+ }
+ lappend coords [lindex $coords 0] [lindex $coords 1]
+ return $coords
+}
+
+set poly [ .r add curve $view [polypoints 200 -200 100 40 0] \
+ -relief raised -linewidth $lw \
+ -fillcolor lightblue -filled t]
+
+set poly [ .r add curve $view [polypoints 450 -200 100 40 0] \
+ -relief raised -linewidth $lw \
+ -fillcolor tan -filled t]
+
+set poly [ .r add curve $view [polypoints 700 -200 100 40 0] \
+ -relief sunken -linewidth $lw \
+ -fillcolor tan -filled t]
+
+set poly [ .r add curve $view [polypoints 200 -450 100 4 -45] \
+ -relief sunken -linewidth $lw \
+ -fillcolor tan -filled t]
+
+
+source "controls.tcl"