PShape::rotate() \ Language (API) \ Processing 1.0
Language (A-Z) \
Libraries \
Tools \
Environment
Reference for Processing version 1.2. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know.
If you prefer a more technical reference, visit the Processing Javadoc.
Class
PShape
Name
rotate()
Examples
PShape s;
void setup() {
size(100, 100);
s = loadShape("ohio.svg");
smooth();
}
void draw() {
background(204);
shape(s);
}
void mousePressed() {
// Rotate the shape each time the mouse is pressed
s.rotate(0.1);
}
Description
Rotates a shape the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to TWO_PI) or converted to radians with the radians() method.
Shapes are always rotated around the upper-left corner of their bounding box. Positive numbers rotate objects in a clockwise direction. Transformations apply to everything that happens after and subsequent calls to the method accumulates the effect. For example, calling rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). This transformation is applied directly to the shape, it's not refreshed each time draw() is run.
Syntax
sh.rotate(angle)
Parameters
sh
PShape: any variable of type PShape
angle
float: angle of rotation specified in radians
Returns
none
Usage
Web & Application
Updated on June 14, 2010 12:05:29pm EDT
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:
PShape rotateYPShape rotateZPShape rotateXPShape rotateZPShape rotateXPShape rotatePShape rotateYrotateXrotate copyfunction swffill rotatetoPShape enableStylerotatePShapePShape isVisiblefunction swfdisplayitem rotatePShape resetMatrixwięcej podobnych podstron