# Called when branched slider changes proc new_branches {foo} { global scherk_branches .view.gl_win ScherkBranches $scherk_branches } # Called when storeys slider changes proc new_storeys {foo} { global scherk_storeys .view.gl_win ScherkStoreys $scherk_storeys } # Called when height slider changes proc new_height {foo} { global scherk_height .view.gl_win ScherkHeight $scherk_height } # Called when flange slider changes proc new_flange {foo} { global scherk_flange .view.gl_win ScherkFlange $scherk_flange } # Called when thickness slider changes proc new_thickness {foo} { global scherk_thickness .view.gl_win ScherkThickness $scherk_thickness } # Called when rim bulge slider changes proc new_rim_bulge {foo} { global scherk_rim_bulge .view.gl_win ScherkRimBulge $scherk_rim_bulge } # Called when azimuth slider changes proc new_azimuth {foo} { global scherk_azimuth .view.gl_win ScherkAzimuth $scherk_azimuth } # Called when twist slider changes proc new_twist {foo} { global scherk_twist .view.gl_win ScherkTwist $scherk_twist } # Called when warp slider changes proc new_warp {foo} { global scherk_warp .view.gl_win ScherkWarp $scherk_warp } # Called when texture tiles slider changes proc new_tex_tiles {foo} { global scherk_tex_tiles .view.gl_win ScherkTexTiles $scherk_tex_tiles } # Called when detail slider changes proc new_detail {foo} { global scherk_detail .view.gl_win ScherkDetail $scherk_detail } # Called when auto rotate check button changes proc new_rotate {} { global rotate .view.gl_win AutoRotate $rotate } # Called when auto wobble check button changes proc new_wobble {} { global wobble .view.gl_win AutoWobble $wobble } # Called when wire frame check button changes proc new_wire_frame {} { global wire_frame .view.gl_win WireFrame $wire_frame } # Called when texture map check button changes proc new_tex_map {} { global tex_map .view.gl_win TexMap $tex_map } # Called when environment map check button changes proc new_env_map {} { global env_map .view.gl_win EnvMap $env_map } # Called when background check button changes proc new_bg_draw {} { global background .view.gl_win Background $background } # Called to set color of background or sculpture proc set_face1_color {} { global face1 global color_select global red green blue global face1_r face1_g face1_b if {$color_select == "SCULP_COLOR"} { if {$face1 == 1} { set face1_r $red; set face1_g $green; set face1_b $blue; .view.gl_win MaterialColor $red $green $blue 0 } } } proc set_face2_color {} { global face2 global color_select global red green blue global face2_r face2_g face2_b if {$color_select == "SCULP_COLOR"} { if {$face2 == 1} { set face2_r $red; set face2_g $green; set face2_b $blue; .view.gl_win MaterialColor $red $green $blue 1 } } } proc set_rim1_color {} { global rim1 global color_select global red green blue global rim1_r rim1_g rim1_b if {$color_select == "SCULP_COLOR"} { if {$rim1 == 1} { set rim1_r $red; set rim1_g $green; set rim1_b $blue; .view.gl_win MaterialColor $red $green $blue 2 } } } proc set_rim2_color {} { global rim2 global color_select global red green blue global rim2_r rim2_g rim2_b if {$color_select == "SCULP_COLOR"} { if {$rim2 == 1} { set rim2_r $red; set rim2_g $green; set rim2_b $blue; .view.gl_win MaterialColor $red $green $blue 3 } } } proc set_rim3_color {} { global rim3 global color_select global red green blue global rim3_r rim3_g rim3_b if {$color_select == "SCULP_COLOR"} { if {$rim3 == 1} { set rim3_r $red; set rim3_g $green; set rim3_b $blue; .view.gl_win MaterialColor $red $green $blue 4 } } } proc new_color {foo} { global color_select global red green blue global bg_r bg_g bg_b global face1_r face1_g face1_b global face2_r face2_g face2_b global rim1_r rim1_g rim1_b global rim2_r rim2_g rim2_b global rim3_r rim3_g rim3_b global face1 face2 global rim1 rim2 rim3 global color_plate $color_plate conf -bg [format \#%02x%02x%02x $red $green $blue] if {$color_select == "BG_COLOR"} { set bg_r $red; set bg_g $green; set bg_b $blue; .view.gl_win BackgroundColor $bg_r $bg_g $bg_b } elseif {$color_select == "SCULP_COLOR"} { set new_sculp_color 0 if {$face1 == 1} { set face1_r $red; set face1_g $green; set face1_b $blue; set new_sculp_color 1 } if {$face2 == 1} { set face2_r $red; set face2_g $green; set face2_b $blue; set new_sculp_color 1 } if {$rim1 == 1} { set rim1_r $red; set rim1_g $green; set rim1_b $blue; set new_sculp_color 1 } if {$rim2 == 1} { set rim2_r $red; set rim2_g $green; set rim2_b $blue; set new_sculp_color 1 } if {$rim3 == 1} { set rim3_r $red; set rim3_g $green; set rim3_b $blue; set new_sculp_color 1 } if {$new_sculp_color == 1} { .view.gl_win MaterialColor $red $green $blue $face1 $face2 \ $rim1 $rim2 $rim3 } } } proc set_plate_color {} { global color_select global red green blue global bg_r bg_g bg_b global face1_r face1_g face1_b global face2_r face2_g face2_b global rim1_r rim1_g rim1_b global rim2_r rim2_g rim2_b global rim3_r rim3_g rim3_b global face1 face2 global rim1 rim2 rim3 global color_plate if {$color_select == "BG_COLOR"} { set red $bg_r; set green $bg_g; set blue $bg_b; } elseif {$color_select == "SCULP_COLOR"} { if {$face1 == 1} { set red $face1_r; set green $face1_g; set blue $face1_b; } elseif {$face2 == 1} { set red $face2_r; set green $face2_g; set blue $face2_b; } elseif {$rim1 == 1} { set red $rim1_r; set green $rim1_g; set blue $rim1_b; } elseif {$rim2 == 1} { set red $rim2_r; set green $rim2_g; set blue $rim2_b; } elseif {$rim3 == 1} { set red $rim3_r; set green $rim3_g; set blue $rim3_b; } else { set red 255; set green 255; set blue 255; } } $color_plate conf -bg [format \#%02x%02x%02x $red $green $blue] } # Called when a new texture is selected proc new_texture {file_name} { .view.gl_win TextureFile $file_name } # Called when a new background is selected proc new_background {file_name} { .view.gl_win BackgroundFile $file_name } # Called when "Start Over" button is pressed proc start_over {} { .view.gl_win StartOver } proc save_file {} { global filename .view.gl_win SaveSpec $filename } proc load_file {} { global filename .view.gl_win LoadSpec $filename } proc inlinescale {name variable from to res label command w l color} { global font_type frame $name -borderwidth 3 -bg $color label $name.l -width $w -text "$label = " -anchor w -bg $color \ -font $font_type label $name.v -width 3 -textvariable $variable -bg $color \ -font $font_type scale $name.s -orient horizontal -length $l -from $from -to $to \ -resolution $res -showvalue false -variable $variable \ -command $command -bg $color pack $name.l $name.v $name.s -side left -fill both -expand true } proc TextureMenu {name} { global tex_file global font_type set w $name.tex_menu catch {destroy $w} toplevel $w wm title $w "Texture Selection" wm geometry $w +300+300 wm resizable $w 0 0 wm transient $w [winfo toplevel [winfo parent $w]] set old_focus [focus] grab set $w focus $w frame $w.tex_top -relief flat -borderwidth 5 label $w.tex_top.label -text "Select one of the following textures:" \ -font $font_type pack $w.tex_top.label -expand true frame $w.tex_list1 -relief flat -borderwidth 5 frame $w.tex_list2 -relief flat -borderwidth 5 frame $w.tex_list3 -relief flat -borderwidth 5 frame $w.tex_list4 -relief flat -borderwidth 5 frame $w.tex_list5 -relief flat -borderwidth 5 image create photo tex1 -file "Images/TR.gif" image create photo tex2 -file "Images/tex0.gif" image create photo tex3 -file "Images/hor.gif" image create photo tex4 -file "Images/TxDiag.gif" image create photo tex5 -file "Images/TxSqre.gif" image create photo tex6 -file "Images/tspb.gif" image create photo tex7 -file "Images/tsbands.gif" image create photo tex8 -file "Images/RimRainbow.gif" image create photo tex9 -file "Images/Tile.Snake.gif" image create photo tex10 -file "Images/checkers.gif" image create photo tex11 -file "Images/ScherkTex.gif" image create photo tex12 -file "Images/ScherkRim.gif" image create photo tex13 -file "Images/woodblocks.gif" image create photo tex14 -file "Images/wood4.gif" #image create photo tex14 -file "Images/RimWood.gif" image create photo tex15 -file "Images/wood2.gif" image create photo tex16 -file "Images/marble2.gif" image create photo tex17 -file "Images/DryMud.gif" image create photo tex18 -file "Images/garnet.gif" image create photo tex19 -file "Images/ivy.gif" image create photo tex20 -file "Images/mosstex.gif" image create photo tex21 -file "Images/swirl10.gif" image create photo tex22 -file "Images/image.gif" image create photo tex23 -file "Images/debri.gif" image create photo tex24 -file "Images/clouds.gif" image create photo tex25 -file "Images/env.gif" button $w.tex_list1.tex1 -image tex1 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/TR.ppm" button $w.tex_list1.tex2 -image tex2 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/tex0.ppm" button $w.tex_list1.tex3 -image tex3 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/hor.ppm" button $w.tex_list1.tex4 -image tex4 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/TxDiag.ppm" button $w.tex_list1.tex5 -image tex5 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/TxSqre.ppm" button $w.tex_list2.tex6 -image tex6 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/tspb.ppm" button $w.tex_list2.tex7 -image tex7 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/tsbands.ppm" button $w.tex_list2.tex8 -image tex8 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/RimRainbow.ppm" button $w.tex_list2.tex9 -image tex9 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/Tile.Snake.ppm" button $w.tex_list2.tex10 -image tex10 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/checkers.ppm" button $w.tex_list3.tex11 -image tex11 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/ScherkTex.ppm" button $w.tex_list3.tex12 -image tex12 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/ScherkRim.ppm" button $w.tex_list3.tex13 -image tex13 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/woodblocks.ppm" button $w.tex_list3.tex14 -image tex14 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/wood4.ppm" #button $w.tex_list3.tex14 -image tex14 -command "catch {focus $old_focus}; \ # destroy $w; new_texture Images/RimWood.ppm" button $w.tex_list3.tex15 -image tex15 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/wood2.ppm" button $w.tex_list4.tex16 -image tex16 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/marble2.ppm" button $w.tex_list4.tex17 -image tex17 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/DryMud.ppm" button $w.tex_list4.tex18 -image tex18 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/garnet.ppm" button $w.tex_list4.tex19 -image tex19 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/ivy.ppm" button $w.tex_list4.tex20 -image tex20 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/mosstex.ppm" button $w.tex_list5.tex21 -image tex21 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/swirl10.ppm" button $w.tex_list5.tex22 -image tex22 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/image.ppm" button $w.tex_list5.tex23 -image tex23 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/debri.ppm" button $w.tex_list5.tex24 -image tex24 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/clouds.ppm" button $w.tex_list5.tex25 -image tex25 -command "catch {focus $old_focus}; \ destroy $w; new_texture Images/env.ppm" pack $w.tex_list1.tex1 $w.tex_list1.tex2 $w.tex_list1.tex3 \ $w.tex_list1.tex4 $w.tex_list1.tex5 -side left -expand true pack $w.tex_list2.tex6 $w.tex_list2.tex7 $w.tex_list2.tex8 \ $w.tex_list2.tex9 $w.tex_list2.tex10 -side left -expand true pack $w.tex_list3.tex11 $w.tex_list3.tex12 $w.tex_list3.tex13 \ $w.tex_list3.tex14 $w.tex_list3.tex15 -side left -expand true pack $w.tex_list4.tex16 $w.tex_list4.tex17 $w.tex_list4.tex18 \ $w.tex_list4.tex19 $w.tex_list4.tex20 -side left -expand true pack $w.tex_list5.tex21 $w.tex_list5.tex22 $w.tex_list5.tex23 \ $w.tex_list5.tex24 $w.tex_list5.tex25 -side left -expand true frame $w.tex_bot -relief flat -borderwidth 5 button $w.tex_bot.cancel -text "Cancel" -font $font_type \ -command "catch {focus $old_focus}; destroy $w" pack $w.tex_bot.cancel -expand true pack $w.tex_top $w.tex_list1 $w.tex_list2 $w.tex_list3 \ $w.tex_list4 $w.tex_list5 $w.tex_bot -side top -expand true } proc BkgroundMenu {name} { global bg_file global font_type set w $name.bg_menu catch {destroy $w} toplevel $w wm title $w "Background Selection" wm geometry $w +300+300 wm resizable $w 0 0 wm transient $w [winfo toplevel [winfo parent $w]] set old_focus [focus] grab set $w focus $w frame $w.bg_top -relief flat -borderwidth 5 label $w.bg_top.label -text "Select one of the following backgrounds:" \ -font $font_type pack $w.bg_top.label -expand true frame $w.bg_list1 -relief flat -borderwidth 5 frame $w.bg_list2 -relief flat -borderwidth 5 frame $w.bg_list3 -relief flat -borderwidth 5 image create photo bg1 -file "Images/stars.gif" image create photo bg2 -file "Images/sky.gif" image create photo bg3 -file "Images/sunset2s.gif" image create photo bg4 -file "Images/curt_green.gif" image create photo bg5 -file "Images/SculptStand.gif" image create photo bg6 -file "Images/sunset.gif" image create photo bg7 -file "Images/FallColors.gif" image create photo bg8 -file "Images/MohaveRedSky.gif" image create photo bg9 -file "Images/RedRockWall.gif" #image create photo bg6 -file "Images/night_sky.gif" button $w.bg_list1.bg1 -image bg1 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/stars.rgb" button $w.bg_list1.bg2 -image bg2 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/sky.rgb" button $w.bg_list1.bg3 -image bg3 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/sunset2s.rgb" button $w.bg_list2.bg4 -image bg4 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/curt_green.rgb" button $w.bg_list2.bg5 -image bg5 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/SculptStand.rgb" button $w.bg_list2.bg6 -image bg6 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/sunset.rgb" button $w.bg_list3.bg7 -image bg7 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/FallColors.rgb" button $w.bg_list3.bg8 -image bg8 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/MohaveRedSky.rgb" button $w.bg_list3.bg9 -image bg9 -command "catch {focus $old_focus}; \ destroy $w; new_background Images/RedRockWall.rgb" pack $w.bg_list1.bg1 $w.bg_list1.bg2 $w.bg_list1.bg3 -side left \ -expand true pack $w.bg_list2.bg4 $w.bg_list2.bg5 $w.bg_list2.bg6 -side left \ -expand true pack $w.bg_list3.bg7 $w.bg_list3.bg8 $w.bg_list3.bg9 -side left \ -expand true frame $w.bg_bot -relief flat -borderwidth 5 button $w.bg_bot.cancel -text "Cancel" -font $font_type \ -command "catch {focus $old_focus}; destroy $w" pack $w.bg_bot.cancel -expand true pack $w.bg_top $w.bg_list1 $w.bg_list2 $w.bg_list3 $w.bg_bot \ -side top -expand true } proc GetFilename {name op} { global filename global font_type if {$name == "."} { set w .file } else { set w $name.file } catch {destroy $w} toplevel $w wm title $w "Get Filename" wm geometry $w +500+500 wm resizable $w 0 0 wm transient $w [winfo toplevel [winfo parent $w]] set old_focus [focus] grab set $w focus $w set filename "" label $w.head -text "Enter a file name for $op" -width 25 -bd 3 \ -font $font_type entry $w.entry -textvariable filename -bd 3 -font $font_type if {[string compare $op save] == 0} { bind $w.entry "catch {focus $old_focus}; destroy $w; \ save_file;" } elseif {[string compare $op load] == 0} { bind $w.entry "catch {focus $old_focus}; destroy $w; \ load_file;" } frame $w.button -bd 3 if {[string compare $op save] == 0} { button $w.button.ok -text "Ok" -font $font_type \ -command "catch {focus $old_focus}; destroy $w; save_file;" } elseif {[string compare $op load] == 0} { button $w.button.ok -text "Ok" -font $font_type \ -command "catch {focus $old_focus}; destroy $w; load_file;" } button $w.button.cancel -text "Cancel" -font $font_type \ -command "catch {focus $old_focus}; destroy $w" pack $w.button.ok $w.button.cancel -side left -padx .2c -pady .2c pack $w.head $w.entry $w.button -side top -padx 5 -pady 5 } proc create_geom_menu {name w l color} { global scherk_branches global scherk_storeys global scherk_height global scherk_flange global scherk_thickness global scherk_rim_bulge global scherk_azimuth global scherk_twist global scherk_warp global scherk_tex_tiles global scherk_detail global font_type frame $name.top -bg $color label $name.top.head -text "SCULPTURE GEOMETRY" -bg $color -font $font_type pack $name.top.head -fill both -expand true frame $name.bot -bg $color inlinescale $name.bot.branches scherk_branches 1 10 1 \ "# of saddle branches" new_branches $w $l $color inlinescale $name.bot.storeys scherk_storeys 1 16 1 "# of holes/storeys" \ new_storeys $w $l $color inlinescale $name.bot.height scherk_height 0.1 5.0 0.1 "Height of storey" \ new_height $w $l $color inlinescale $name.bot.flange scherk_flange 0.7 5.0 0.1 "Width of flange" \ new_flange $w $l $color inlinescale $name.bot.thickness scherk_thickness 0.0 0.5 0.01 \ "Thickness of vane" new_thickness $w $l $color inlinescale $name.bot.rim_bulge scherk_rim_bulge 0.0 4.0 0.01 \ "Amount of rim bulge" new_rim_bulge $w $l $color inlinescale $name.bot.twist scherk_twist -900 1080 15 "Overall axial twist" \ new_twist $w $l $color inlinescale $name.bot.azimuth scherk_azimuth -360 360 5 "Turn around axis" \ new_azimuth $w $l $color inlinescale $name.bot.warp scherk_warp 0 1080 10 "Bend towards arch" \ new_warp $w $l $color inlinescale $name.bot.tex_tiles scherk_tex_tiles 0 10 1 \ "# of texture tiles" new_tex_tiles $w $l $color inlinescale $name.bot.detail scherk_detail 1 16 1 "Grid detail" new_detail \ $w $l $color pack $name.bot.branches $name.bot.storeys $name.bot.height \ $name.bot.flange $name.bot.thickness $name.bot.rim_bulge \ $name.bot.twist $name.bot.azimuth $name.bot.warp \ $name.bot.tex_tiles $name.bot.detail\ -side top -fill both -expand true pack $name.top $name.bot -side top -fill both -expand true } proc create_disp_menu {name w color} { global rotate global wobble global wire_frame global tex_map global env_map global background global font_type frame $name.top -bg $color label $name.top.head -text "DISPLAY MODE" -bg $color -font $font_type pack $name.top.head -fill both -expand true frame $name.mid -bg $color frame $name.mid.left -bg $color frame $name.mid.right -bg $color checkbutton $name.mid.right.rotate -text "Auto Rotate" -anchor w \ -bg $color -borderwidth 3 -width 15 -variable rotate \ -command new_rotate -font $font_type checkbutton $name.mid.right.wobble -text "Auto Wobble" -anchor w \ -bg $color -borderwidth 3 -width 15 -variable wobble \ -command new_wobble -font $font_type checkbutton $name.mid.right.wiref -text "Wire frame" -anchor w -bg $color \ -borderwidth 3 -width 15 -variable wire_frame \ -command new_wire_frame -font $font_type checkbutton $name.mid.left.texm -text "Texture Map" -anchor w -bg $color \ -borderwidth 3 -width 15 -variable tex_map -command new_tex_map \ -font $font_type checkbutton $name.mid.left.envm -text "Environment Map" -anchor w \ -bg $color -borderwidth 3 -width 15 -variable env_map \ -command new_env_map -font $font_type checkbutton $name.mid.left.bg -text "Background" -anchor w -bg $color \ -borderwidth 3 -width 15 -variable background -command new_bg_draw \ -font $font_type pack $name.mid.left.texm $name.mid.left.envm $name.mid.left.bg \ -side top -fill both -expand true pack $name.mid.right.rotate $name.mid.right.wobble $name.mid.right.wiref \ -side top -fill both -expand true pack $name.mid.left $name.mid.right -side left -fill both -expand true frame $name.button -bg $color button $name.button.texture -text "Select Texture" -borderwidth 3 \ -width 13 -bg $color -command "TextureMenu $name.button.texture" \ -font $font_type button $name.button.bkground -text "Pick Background" -borderwidth 3 \ -width 13 -bg $color -command "BkgroundMenu $name.button.bkground" \ -font $font_type button $name.button.reset -text "Start Over" -borderwidth 3 \ -width 13 -bg $color -command "init_values; start_over" \ -font $font_type pack $name.button.texture $name.button.bkground $name.button.reset \ -side left -expand true -padx .1c -pady .1c pack $name.top $name.mid $name.button -side top -fill both -expand true } proc create_color_menu {name w l color} { global color_select global red green blue global color_plate global font_type frame $name.top -bg $color label $name.top.head -text "COLOR SELECTION" -bg $color -font $font_type pack $name.top.head -fill both -expand true frame $name.mid -bg $color radiobutton $name.mid.bkground -text "Set Color for Background" -anchor w \ -bg $color -variable color_select -value BG_COLOR \ -command set_plate_color -font $font_type radiobutton $name.mid.sculpture -text "Set Color for Sculpture" -anchor w \ -bg $color -variable color_select -value SCULP_COLOR \ -command set_plate_color -font $font_type frame $name.mid.sculp_select -bg $color label $name.mid.sculp_select.head -width 3 -bg $color -font $font_type checkbutton $name.mid.sculp_select.face1 -text "Face 1" -width 6 \ -anchor w -bg $color -variable face1 -command set_face1_color \ -font $font_type checkbutton $name.mid.sculp_select.face2 -text "Face 2" -width 6 \ -anchor w -bg $color -variable face2 -command set_face2_color \ -font $font_type checkbutton $name.mid.sculp_select.rim1 -text "Rim 1" -width 6 \ -anchor w -bg $color -variable rim1 -command set_rim1_color \ -font $font_type checkbutton $name.mid.sculp_select.rim2 -text "Rim 2" -width 6 \ -anchor w -bg $color -variable rim2 -command set_rim2_color \ -font $font_type checkbutton $name.mid.sculp_select.rim3 -text "Rim 3" -width 6 \ -anchor w -bg $color -variable rim3 -command set_rim3_color \ -font $font_type pack $name.mid.sculp_select.head $name.mid.sculp_select.face1 \ $name.mid.sculp_select.face2 $name.mid.sculp_select.rim1 \ $name.mid.sculp_select.rim2 $name.mid.sculp_select.rim3 \ -side left -fill both -expand true pack $name.mid.bkground $name.mid.sculpture $name.mid.sculp_select \ -side top -expand true -anchor w frame $name.bot -bg $color inlinescale $name.bot.r red 0 255 1 "Red" new_color $w $l $color inlinescale $name.bot.g green 0 255 1 "Greeen" new_color $w $l $color inlinescale $name.bot.b blue 0 255 1 "Blue" new_color $w $l $color pack $name.bot.r $name.bot.g $name.bot.b -side top -fill both -expand true frame $name.c_sample -height 80 -relief groove -borderwidth 2 \ -bg [format \#%02x%02x%02x $red $green $blue] set color_plate $name.c_sample pack $name.top $name.mid $name.bot $name.c_sample \ -side top -fill both -expand true -padx .05c -pady .05c } # Make the widgets proc setup {} { wm title . "Sculpture Generator by Carlo H. Sequin at U.C.Berkeley" #wm geometry . 900x900+0+0 wm geometry . 1280x1014+0+0 wm resizable . 0 0 ## OpenGL Window frame .view -relief ridge -borderwidth 5 togl .view.gl_win -rgba true -double true \ -depth true -time 10 pack .view.gl_win -expand true -fill both ## Menu Frame frame .menu ## Sculpture Geometry set geom_color [format \#%02x%02x%02x 205 215 245] frame .menu.geom -relief ridge -borderwidth 5 -bg $geom_color create_geom_menu .menu.geom 14 150 $geom_color #create_geom_menu .menu.geom 18 150 $geom_color ## Display Mode set disp_color [format \#%02x%02x%02x 205 245 215] frame .menu.display -relief ridge -borderwidth 5 -bg $disp_color create_disp_menu .menu.display 18 $disp_color ## Color Select set color_color [format \#%02x%02x%02x 245 215 205] frame .menu.color -relief ridge -borderwidth 5 -bg $color_color create_color_menu .menu.color 5 200 $color_color #create_color_menu .menu.color 8 200 $color_color pack .menu.geom .menu.display .menu.color -side top \ -fill both -expand true ## Main Widgets pack .view -side right -fill both -expand true pack .menu -side left -fill y bind .view.gl_win ".view.gl_win HandleButton %b 1 %x %y" bind .view.gl_win ".view.gl_win HandleButton %b 0 %x %y" bind .view.gl_win ".view.gl_win HandleMotion 1 %x %y" bind .view.gl_win ".view.gl_win HandleMotion 2 %x %y" bind .view.gl_win ".view.gl_win HandleMotion 3 %x %y" bind . "GetFilename . save" bind . "GetFilename . load" } proc init_values {} { global scherk_branches scherk_storeys scherk_height global scherk_flange scherk_thickness scherk_rim_bulge global scherk_azimuth scherk_twist scherk_warp global scherk_tex_tiles scherk_detail global rotate wobble global wire_frame tex_map env_map background global color_select global red green blue global bg_r bg_g bg_b global face1_r face1_g face1_b global face2_r face2_g face2_b global rim1_r rim1_g rim1_b global rim2_r rim2_g rim2_b global rim3_r rim3_g rim3_b global face1 face2 global rim1 rim2 rim3 global color_plate global tex_file bg_file # Set default values set scherk_branches 2; set scherk_storeys 2; set scherk_height 1.5; set scherk_flange 1.5; set scherk_thickness 0.15; set scherk_rim_bulge 1.5; set scherk_azimuth 0; set scherk_twist 0; set scherk_warp 0; set scherk_tex_tiles 1; set scherk_detail 5; set rotate 0; set wobble 0; set tex_map 0; set env_map 0; set wire_frame 0; set background 0; set color_select BG_COLOR; set red 0; set green 0; set blue 0; set bg_r 0; set bg_g 0; set bg_b 0; set face1_r 255; set face1_g 255; set face1_b 255; set face2_r 255; set face2_g 255; set face2_b 255; set rim1_r 255; set rim1_g 255; set rim1_b 255; set rim2_r 255; set rim2_g 255; set rim2_b 255; set rim3_r 255; set rim3_g 255; set rim3_b 255; set face1 0; set face2 0; set rim1 0; set rim2 0; set rim3 0; $color_plate conf -bg [format \#%02x%02x%02x $red $green $blue]; set tex_file ""; set bg_file ""; } # Execution starts here! set font_type -*-times-medium-r-*-18-* setup init_values