can't find package tcl3d 0.5.0
    while executing
"package require tcl3d 0.5.0"
    (in namespace eval "::request" script line 9)
    invoked from within
"namespace eval ::request $script"
    ("::try" body line 12)

OUTPUT BUFFER:

# Light.tcl # # Original C++ code by Peter Wraae Marino and Michael Bach Jensen. # See www.osghelp.com for the original files. # # Modified for Tcl3D by Paul Obermeier 2010/03/20. # See www.tcl3d.org for the Tcl3D extension. package require tcl3d 0.5.0 # Font to be used in the Tk listbox. set gDemo(listFont) {-family {Courier} -size 10} # Window size. set gDemo(winWidth) 640 set gDemo(winHeight) 480 # Determine the directory and filename of this script. set gDemo(scriptFile) [info script] set gDemo(scriptDir) [file dirname $gDemo(scriptFile)] # Show errors occuring in the Togl callbacks. proc bgerror { msg } { puts "Error: $msg\n\n$::errorInfo" tk_messageBox -icon error -type ok -message "Error: $msg\n\n$::errorInfo" ExitProg } # Print info message into widget a the bottom of the window. proc PrintInfo { msg } { if { [winfo exists .fr.info] } { .fr.info configure -text $msg } } # Idle callback to redisplay the scene. proc Animate {} { .fr.toglwin postredisplay set ::animateId [tcl3dAfterIdle Animate] } proc StartAnimation {} { if { ! [info exists ::animateId] } { Animate } } proc StopAnimation {} { if { [info exists ::animateId] } { after cancel $::animateId unset ::animateId } } proc CreateCallback { toglwin } { } proc ReshapeCallback { toglwin { w -1 } { h -1 } } { set w [$toglwin width] set h [$toglwin height] # Propagate resize event to embedded OSG window. tcl3dOsgWindowResize $toglwin [tcl3dOsgGetOsgWin] $w $h } proc DisplayCallback { toglwin } { if { [viewer valid] } { viewer frame } $toglwin swapbuffers } proc Cleanup {} { uplevel #0 unset gDemo viewer -delete } proc ExitProg {} { exit } proc SaveOsgToFile {} { global gDemo set osgRoot [viewer getSceneData] set outFile [format "%s.osg" [file rootname $gDemo(scriptFile)]] # Create a name on the file system, if running from within a Starpack. set outFile [tcl3dGenExtName $outFile] puts "Saving scenegraph to file $outFile" if { ! [osgDB::writeNodeFile $osgRoot $outFile] } { puts "Failed to write scenegraph to file $outFile" } } proc CreateWidgets { osgwin } { global gDemo frame .fr pack .fr -expand 1 -fill both set toglwin .fr.toglwin togl $toglwin -width $gDemo(winWidth) -height $gDemo(winHeight) \ -double true -depth true -alpha true \ -createproc CreateCallback \ -reshapeproc ReshapeCallback \ -displayproc DisplayCallback listbox .fr.usage -font $gDemo(listFont) -height 3 label .fr.info grid $toglwin -row 0 -column 0 -sticky news grid .fr.usage -row 1 -column 0 -sticky news grid .fr.info -row 2 -column 0 -sticky news grid rowconfigure .fr 0 -weight 1 grid columnconfigure .fr 0 -weight 1 wm title . "Tcl3D demo: OsgHelp tutorial Light" wm protocol . WM_DELETE_WINDOW "ExitProg" bind . "ExitProg" bind . "SaveOsgToFile" # Propagate key and mouse events to embedded OSG window. bind . "tcl3dOsgKeyPress $toglwin $osgwin %N" tcl3dOsgAddTrackballBindings $toglwin $osgwin .fr.usage insert end "Key-Escape Exit" .fr.usage insert end "Key-f Save SceneGraph to file" .fr.usage insert end "Mouse Trackball" .fr.usage configure -state disabled } # # Start of tutorial specific code. # proc CreateSpheres { z } { osg::Geode geode geode addDrawable [osg::ShapeDrawable dr1 [osg::Sphere sph1 [osg::Vec3 c1 0.0 0.0 $z] 0.5]] geode addDrawable [osg::ShapeDrawable dr2 [osg::Sphere sph2 [osg::Vec3 c2 2.0 0.0 $z] 0.5]] geode addDrawable [osg::ShapeDrawable dr3 [osg::Sphere sph3 [osg::Vec3 c3 4.0 0.0 $z] 0.5]] geode addDrawable [osg::ShapeDrawable dr4 [osg::Sphere sph4 [osg::Vec3 c4 6.0 0.0 $z] 0.5]] geode addDrawable [osg::ShapeDrawable dr5 [osg::Sphere sph5 [osg::Vec3 c5 8.0 0.0 $z] 0.5]] return geode } proc CreateScene {} { osg::Group group # osg:Light allows us to set default parameter values to be used by osg::LightSource osg::Light light light setLightNum 4 light setAmbient [osg::Vec4 amb 0.0 0.0 0.0 0.0] light setDiffuse [osg::Vec4 dif 1.0 0.0 0.0 1.0] light setPosition [osg::Vec4 pos 1 0 0 0] # last param w = 0.0 directional light (direction) # w = 1.0 point light (position) # light source osg::LightSource lightSource lightSource setLight light group addChild lightSource group addChild [CreateSpheres 0] group addChild [CreateSpheres 2] group addChild [CreateSpheres 4] group addChild [CreateSpheres 6] [group getOrCreateStateSet] setMode $::GL_LIGHT4 $::osg::StateAttribute_ON return group } if { ! [tcl3dHaveOsg] } { tk_messageBox -icon warning -type ok -title "Missing Tcl3D module" \ -message "Sorry, no OpenSceneGraph library available." ExitProg } # We have the geometry ready. Now create the viewer and the Tk widgets. osgViewer::ViewerRef viewer [osgViewer::Viewer] # set the scene-graph data the viewer will render viewer setSceneData [CreateScene] viewer setCameraManipulator [osgGA::TrackballManipulator] if { $argc >= 1 && [lindex $argv 0] eq "-viewer" } { # Only use the standard OSG viewer window without any Tk widgets. viewer setUpViewInWindow 50 50 500 400 viewer run exit 0 } # Use the OSG viewer inside a Togl widget. set osgwin [viewer setUpViewerAsEmbeddedInWindow 50 50 500 400] tcl3dOsgSetOsgWin $osgwin viewer realize CreateWidgets $osgwin PrintInfo [format "Running on %s %s with a %s (OSG %s, Tcl/Tk %s)" \ $tcl_platform(os) $tcl_platform(osVersion) \ [glGetString GL_RENDERER] \ [tcl3dOsgGetVersion] [info patchlevel]] if { [file tail [info script]] == [file tail $::argv0] } { # If started directly from tclsh or wish, then start animation. update StartAnimation }