processing.core
Class PShape

java.lang.Object
  extended by processing.core.PShape

public class PShape
extends java.lang.Object


Field Summary
 float px
           
 float py
           
 float x
           
 float y
           
 
Constructor Summary
PShape()
           
PShape(float x, float y)
           
 
Method Summary
 void addChild(PShape who)
           
 void applyMatrix(float n00, float n01, float n02, float n10, float n11, float n12)
           
 void applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)
           
 void center()
          Center the shape based on its bounding box.
 PShape createGroup()
           
 void draw(PGraphics g)
          Called by the following (the shape() command adds the g) PShape s = loadShapes("blah.svg"); shape(s);
 void pivot(float x, float y)
          Set the pivot point for all transformations.
 void rotate(float angle)
           
 void rotate(float angle, float v0, float v1, float v2)
           
 void rotateX(float angle)
           
 void rotateY(float angle)
           
 void rotateZ(float angle)
           
 void scale(float s)
           
 void scale(float sx, float sy)
           
 void scale(float x, float y, float z)
           
 void translate(float tx, float ty)
           
 void translate(float tx, float ty, float tz)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public float x

y

public float y

px

public float px

py

public float py
Constructor Detail

PShape

public PShape()

PShape

public PShape(float x,
              float y)
Method Detail

draw

public void draw(PGraphics g)
Called by the following (the shape() command adds the g) PShape s = loadShapes("blah.svg"); shape(s);


addChild

public void addChild(PShape who)

createGroup

public PShape createGroup()

translate

public void translate(float tx,
                      float ty)

translate

public void translate(float tx,
                      float ty,
                      float tz)

rotateX

public void rotateX(float angle)

rotateY

public void rotateY(float angle)

rotateZ

public void rotateZ(float angle)

rotate

public void rotate(float angle)

rotate

public void rotate(float angle,
                   float v0,
                   float v1,
                   float v2)

scale

public void scale(float s)

scale

public void scale(float sx,
                  float sy)

scale

public void scale(float x,
                  float y,
                  float z)

applyMatrix

public void applyMatrix(float n00,
                        float n01,
                        float n02,
                        float n10,
                        float n11,
                        float n12)

applyMatrix

public void applyMatrix(float n00,
                        float n01,
                        float n02,
                        float n03,
                        float n10,
                        float n11,
                        float n12,
                        float n13,
                        float n20,
                        float n21,
                        float n22,
                        float n23,
                        float n30,
                        float n31,
                        float n32,
                        float n33)

center

public void center()
Center the shape based on its bounding box. Can't assume that the bounding box is 0, 0, width, height. Common case will be opening a letter size document in Illustrator, and drawing something in the middle, then reading it in as an svg file. This will also need to flip the y axis (scale(1, -1)) in cases like Adobe Illustrator where the coordinates start at the bottom.


pivot

public void pivot(float x,
                  float y)
Set the pivot point for all transformations.