Scale


This command changes the scale of an object. The command may be used in one of two ways: the object may be uniformly scaled up or down in all directions, or the object may be scaled differently in the x, y, and z directions.

 object.Scale(ScaleRatio) 

or

 object.Scale(xratio,yratio,zratio) 

Parameters

ScaleRatio

The factor by which to scale the object. A value of 1 causes no change, 2 doubles the size of the object, 0.5 scales the object down to one half its size, and so on.

xratio , yratio , zratio

Scales the object only about that axis. For example, if xratio is 2 and the other values are 1, then the object is scaled up only in the x direction, by a factor of two.

Notes

Having different values for xratio , yratio , and zratio will distort the object.

Sample Code

 oworld = New World(); ocamera = New Camera(oworld); obrick = oworld.CreateBrick(50,50,50); ocamera.MoveBack(1200); obrick.Scale(2,1,1); //Loop While(TRUE)  {   } 



Elementary Game Programming and Simulators Using Jamagic
Elementary Game Programming & Simulations Using Jamagic (Charles River Media Game Development)
ISBN: 1584502614
EAN: 2147483647
Year: 2002
Pages: 105
Authors: Sergio Perez

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net