| |
Description:
BSpace is an external Processing library
that helps with the placement and transformation of graphical content
on the stage. Each BSpace object is similar to a Flash movieclip or Photoshop
Layer, in the sense that it provides a separate environment for content
to reside in. BSpace
also introduces hierarchical structure to Processing,
by enabling us to create nested transformation environments. In doing
so, BSpace provides an object-oriented approach to push/pop and other
transformation-matrix methods.
I was very careful not to change the nature and clarity of the core language.
You'll notice that there are almost no new commands to learn. Simply use
the good old processing commands inside the BSpace
object.
Quick Syntax Overview:
The BSpace myNewSpace = new BSpace(this) command creates
a separate environment to place shapes in.
All the usual Processing transformations can be applied to this environment
like so:
myNewSpace.rotateX(1.3)
myNewSpace.scale(2) etc.
These transformations will only affect the shapes drawn in myNewSpace
, and leave all other content on stage untouched.
A new shape can be drawn onto the new BSpace using the usual Processing
shape-commands: myNewSpace.rect(0,0,10,10)
myNewSpace.box(10) etc.
Furthermore:
Each BSpace environment has an Positioning Axis which
sets the 0,0 registration point for drawing shapes: setAxis(x,y,z),
getAxisX() /Y/Z.
Each BSpace environment has a rotation/scale Pivot Point:
setPivot(x,y,z), getPivotX() /Y/Z.
Bspace environments can be nested inside each other:
myNewSpace.nestIn(someOtherSpace).
For Optimization purposes, each BSpace may be use the smooth()/noSmooth()
commands
Notes:
About BSpace and Push/Pop:
Without a better understanding of Transformation Matrix, Push/Pop remain
very abstract notions to my students. I often have to branch into this
subject too early in the course. BSpace
is an object-oriented alternative which students seem to feel comfortable
with. In addition, it is a very practical pathway to object-oriented-programming
and the dot syntax.
Correlation to other platforms
I find that visually oriented minds are very comfortable with the notion
of 'Objects'.
To Flash users, BSpace is somewhat similar
to Movieclips (Photoshop and Director users are familiar with Layers).
BSpace proves to bridge some gaps when users of these platforms
first approach Processing.
|