scale() \ Language (API) \ Processing 1.0
Search processing.org:
Language (A-Z) \
Libraries \
Tools \
Environment \
Compare \
Troubleshooting
Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Name
scale()
Examples
rect(30, 20, 50, 50);
scale(0.5);
rect(30, 20, 50, 50);rect(30, 20, 50, 50);
scale(0.5, 1.3);
rect(30, 20, 50, 50);// Scaling in 3D requires P3D
// or OPENGL as a parameter to size()
size(100, 100, P3D);
fill(255, 102);
translate(width/2+12, height/2);
box(20, 20, 20);
scale(2.5, 2.5, 2.5);
box(20, 20, 20);
Description
Increases or decreases the size of a shape by expanding and contracting vertices. Objects always scale from their relative origin to the coordinate system. Scale values are specified as decimal percentages. For example, the function call scale(2.0) increases the dimension of a shape by 200%. Transformations apply to everything that happens after and subsequent calls to the function multiply the effect. For example, calling scale(2.0) and then scale(1.5) is the same as scale(3.0). If scale() is called within draw(), the transformation is reset when the loop begins again. Using this fuction with the z parameter requires passing P3D or OPENGL into the size() parameter as shown in the example above. This function can be further controlled by pushMatrix() and popMatrix().
Syntax
scale(size);
scale(x, y);
scale(x, y, z);
Parameters
size
float: percentage to scale the object
x
float: percentage to scale the object in the x-axis
y
float: percentage to scale the object in the y-axis
z
float: percentage to scale the object in the z-axis
Returns
None
Usage
Web & Application
Related
translate() rotate() rotateX() rotateY() rotateZ() pushMatrix() popMatrix()
Updated on November 22, 2008 08:39:25pm PST
Processing was initiated by Ben Fry and Casey Reas. It is developed by a small team of volunteers.
© Info \
Site hosted by Media Temple!
Wyszukiwarka
Podobne podstrony:
scalearm scale q7?arm mat scale q31?Rheology of Nano Scale Aluminum SuspensionsHalting viruses in scale free networksarm scale q31?function swfdisplayitem scalearm scale q15? sourcefunction pdf scalearm scale ?2? sourceSHSpec 006 6106C02 Flows, Prehav Scale, Primary Scaledeveloping large scale systems with the rational unified processzA2AF65SHSpec 084 6111C23 Auxiliary Prehav 3D Scalearm mat scale q15?więcej podobnych podstron