Action:
|
Copies a transform.
|
|
Filename:
|
kern/kern_scm/tran_scm.cxx
|
|
Syntax:
|
(transform:copy transform)
|
|
Arg Types:
|
transform
|
transform
|
|
Returns:
|
transform
|
|
Description:
|
Copies a transform into a duplicate but distinct transform.
|
|
|
transform specifies the transformation to be copied.
|
|
Example:
|
; transform:copy
|
|
; Create a WCS.
|
|
(define wcs1
|
|
|
(wcs (position 0 0 0) (gvector 1 0 0)
|
|
|
(gvector 0 1 0)))
|
|
;; wcs1
|
|
; Set a color for the wcs.
|
|
(entity:set-color wcs1 6)
|
|
;; ()
|
|
; Create a solid block.
|
|
(define block1
|
|
|
(solid:block (position 0 0 0)
|
|
|
(position 5 10 15)))
|
|
;; block1
|
|
; OUTPUT Original
|
|
|
; Apply a new transform by copying the existing
|
|
; transform and adding a translation.
|
|
(define transform1
|
|
|
(transform:translation (gvector 4 0 0)))
|
|
;; transform1
|
|
(define copy1 (transform:copy transform1))
|
|
;; copy1
|
|
(define entity1
|
|
|
(entity:transform block1 transform1))
|
|
;; entity1
|
|
(roll -1)
|
|
;; -1
|
|
(define entity1
|
|
|
(entity:transform block1 copy1))
|
|
;; entity1
|
|
; OUTPUT Result
|
|
|
|
|
Figure 15-4. transform:copy
|