afig:create
List of: Scheme Extensions
Subjects: Animation, Rubberbanding
Contents: Graphic Interaction

Action: Creates an animation-figure.

Filename: gi/gi_scm/afig_scm.cxx

Syntax: (afig:create entity-lits)

Arg Types: entity-list entity | (entity ...)

Returns: animation-figure

Description: Creates an animation figure from a list of entities. An animation figure is a type of rubberband driver.

Example: ; afig:create

; Create a figure to rotate

(define block1


(solid:block (position 0 0 0)


(position 10 15 20)))

;; block1

(define cyl1


(solid:cylinder (position 4 8 12)


(position 8 -10 -15) 5))

;; cyl1

; Define the animation figure.

(define fig (afig:create (list block1 cyl1)))

;; fig

; Highlight the animated figure.

(afig:show fig)

;; ()

; Define the rotation of the transform.

(define t


(transform:rotation (position 0 0 0)


(gvector 0 1 0) 1))

;; t

; OUTPUT Original


; Define the rotation as 200 degrees and apply the

; transform to the animation figure.

(let loop ((i 0))


(if (< i 200) (begin



(afig:apply-transform fig t)



(loop (+ i 1))


)))

;; ()

; Displays the block and cylinder rotating

; 200 degrees.

; OUTPUT Result



Figure 1-2. afig:create
PDF/GI/01SCA.PDF
HTM/DATA/GI/GI/01SCA/0002.HTM