;; Fu Jie Huang, March 2003
;; a simple viewer.
;; to make life easier, we included one file "sphereMan.iv" in this directory
;; to view other model files, you need to change the "modelfile" variable
;; if you have installed Open Inventor, chances are you already have a lot of 
;; model files, under the directory $INVENTOR/data/models/

(libload "inventor/inventor")
(libload "inventor/inventorxt")

(setq modelfile (concat lushdir "/packages/inventor/demos/sphereMan.iv"))

(setq mywindow (soxt_init "lush"))
(setq root  (new soseparator ()))
(setq mylight   (new sodirectionallight ()))

(==> root ref)
(==> root addChild :mylight:p)
(let ((myinput (new SoInput ())))
  (when (= 1 (==> myinput openFile modelfile 0))
    (progn-without-fpe (==> root addChild (SoDB_readAll :myinput:p)))))

(setq myviewer (new soxtexaminerviewer mywindow "test" 1 1 1 ()))
(==> myviewer setscenegraph :root:p)
(==> myviewer show)
(soxt_show mywindow)

