Action:
|
Creates a transform to mirror an object through an axis.
|
|
Filename:
|
kern/kern_scm/tran_scm.cxx
|
|
Syntax:
|
(transform:reflection plane-position
|
|
|
plane-direction)
|
|
Arg Types:
|
plane-position
|
position
|
|
plane-direction
|
gvector
|
|
Returns:
|
transform
|
|
|
plane-position specifies the location to mirror an object.
|
|
|
plane-direction specifies the normal of the mirror in the plane.
|
|
Example:
|
; transform:reflection
|
|
; Define a working coordinate system.
|
|
(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
|
|
|
; Create a transform and then create its reflection.
|
|
(define transform1
|
|
|
(transform:reflection
|
|
|
(position 0 0 0) (gvector -1 0 0)))
|
|
;; transform1
|
|
; Apply the transform to reflect the block.
|
|
(define transform
|
|
|
(entity:transform block1 transform1))
|
|
;; transform
|
|
; OUTPUT Result
|
|
|
|
|
Figure 15-6. transform:reflection
|