transform:scaling
List of: Scheme Extensions
Subjects: Modifying Models, Transforms
Contents: Kernel

Action: Creates a scaling transform.

Filename: kern/kern_scm/tran_scm.cxx

Syntax: (transform:scaling x-scale [y-scale z-scale])

Arg Types: x-scale real

y-scale real

z-scale real

Returns: transform

Description: Although the extension accepts a scale of 0 or less, only a positive scale factor is recommended.


Uniform scaling is recommended, whereby only the x-scale term is supplied. All three components of the position, of the gvector, and dimensions along the axes are multiplied by the same x-scale factor.


x-scale specifies the scaling factor for the x-axis direction.


y-scale is an optional argument that specifies the scaling factor for the y-axis direction.


z-scale is an optional argument that specifies the scaling factor for the z-axis direction.

Example: ; transform:scaling

; 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 15 20 15)))

;; block1

; OUTPUT Original


; Create a transform and then create its reflection.

(define transform1


(transform:scaling 0.75 0.75 0.25))

;; transform1

; Apply the transform to reflect the block.

(define transform


(entity:transform block1 transform1))

;; transform

; OUTPUT Result



Figure 15-8. transform:scaling
PDF/KERN/15SCR.PDF
HTM/DATA/KERN/KERN/15SCR/0045.HTM