Action:
|
Concatenates two transforms.
|
|
Filename:
|
kern/kern_scm/tran_scm.cxx
|
|
Syntax:
|
(transform:compose transform1 transform2)
|
|
Arg Types:
|
transform1
|
transform
|
|
transform2
|
transform
|
|
Returns:
|
transform
|
|
Description:
|
Concatenates two transforms. Permits the creation of more complex transforms from simpler transforms such as reflection, rotation, scaling, and translation.
|
|
|
transform1 and
transform2 arguments specify the transformations to be concatenated.
|
|
Example:
|
; transform:compose
|
|
; 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
|
|
|
; Transform the solid block from model space to
|
|
; the created working space as defined by the WCS.
|
|
; Concatenate two transforms.
|
|
(define comp1 (transform:compose
|
|
|
(transform:rotation (position 0 0 0)
|
|
|
(gvector -3 0 0) 45)
|
|
|
(transform:axes (position 0 0 0)
|
|
|
(gvector -8 0 0) (gvector 0 6 0))))
|
|
;; comp1
|
|
; comp1
|
|
(define transform (entity:transform block1 comp1))
|
|
;; transform
|
|
; OUTPUT Result
|
|
|
|
|
Figure 15-3. transform:compose
|