## 1/10/96

Problems
Problem 1 - Make a scene

```;;; Problem 1-1

;; create a viewer

(define viewer (new-SoXtExaminerViewer))
(-> viewer 'show)

;; create root of scene graph and ref it

(define root (new-SoSeparator))
(-> root 'ref)

;; create nodes for left and right eyes.
;; note that left eye is at the origin

(define eye-mat (new-SoMaterial))
(define eye-xform (new-SoTransform))
(-> (-> eye-xform 'translation) 'setValue 3 0 0)

;; create nodes for nose

(define nose-mat (new-SoMaterial))
(define nose-xform (new-SoTransform))
(-> (-> nose-xform 'translation) 'setValue -1.5 -3 0)

;; create nodes for mouth

(define mouth-mat (new-SoMaterial))
(define mouth-xform (new-SoTransform))
(-> (-> mouth-xform 'translation) 'setValue 0 -3 0)

;; show the scene graph

(-> viewer 'setSceneGraph root)
```
Problem 2 - Reorganize the scene

```;;; Problem 1-2

;; create viewer and show it

(define viewer (new-SoXtExaminerViewer))
(-> viewer 'show)

;; root of scene graph

(define root (new-SoSeparator))
(-> root 'ref)

;; separator and nodes for left eye

(define left-eye-sep (new-SoSeparator))
(define left-eye-mat (new-SoMaterial))
(define left-eye-xform (new-SoTransform))

;; separator and nodes for right eye

(define right-eye-sep (new-SoSeparator))
(define right-eye-mat (new-SoMaterial))
(define right-eye-xform (new-SoTransform))
(-> (-> right-eye-xform 'translation) 'setValue 3 0 0)

;; separator and nodes for nose

(define nose-sep (new-SoSeparator))
(define nose-mat (new-SoMaterial))
(define nose-xform (new-SoTransform))
(-> (-> nose-xform 'translation) 'setValue 1.5 -3 0)

;; separator and nodes for mouth

(define mouth-sep (new-SoSeparator))
(define mouth-mat (new-SoMaterial))
(define mouth-xform (new-SoTransform))
(-> (-> mouth-xform 'translation) 'setValue 1.5 -6 0)

;; show scene graph

(-> viewer 'setSceneGraph root)
```
Problem 3 - Manipulate the scene

```;;; Problem 1-3
;;; Same as 1-2, but with manipulators
;;; attached to all objects.

(define viewer (new-SoXtExaminerViewer))
(-> viewer 'show)

(define root (new-SoSeparator))
(-> root 'ref)

(define left-eye-sep (new-SoSeparator))
(define left-eye-mat (new-SoMaterial))
(define left-eye-xform (new-SoHandleBoxManip))

(define right-eye-sep (new-SoSeparator))
(define right-eye-mat (new-SoMaterial))
(define right-eye-xform (new-SoHandleBoxManip))
(-> (-> right-eye-xform 'translation) 'setValue 3 0 0)

(define nose-sep (new-SoSeparator))
(define nose-mat (new-SoMaterial))
(define nose-xform (new-SoHandleBoxManip))
(-> (-> nose-xform 'translation) 'setValue 1.5 -3 0)

(define mouth-sep (new-SoSeparator))
(define mouth-mat (new-SoMaterial))
(define mouth-xform (new-SoHandleBoxManip))
(-> (-> mouth-xform 'translation) 'setValue 1.5 -6 0)

(-> viewer 'setSceneGraph root)
```