# Axis
Todo: Lot of examples.
# X and Y Axis Example
// Explainer APi
const mw = await createMW ()
mw.add.axis.setOrigin ( Origin.CENTER )
// Axis X Options
const axisOptX = {
from: -5, to: 5, period: 1, periodSize: 8,
color: '#888888', thickness: 2, fontSize: 4
}
mw.add.axis.addXAxis ( axisOptX )
// Axis Y Options
const axisOptY = {
from: -5, to: 5, period: 1, periodSize: 8,
color: '#448888', thickness: 2, fontSize: 4
}
mw.add.axis.addYAxis ( axisOptY )
mw.add.axis.create ()
Result:
# Explainer Api Coordinate system
There are three coordinate systems:
- Browser, origin is top-left
- Three.js, origin is center
- User defined, origin can be:
export enum Origin {
CENTER,
TOP_LEFT,
TOP_RIGHT,
BOTTOM_LEFT,
BOTTOM_RIGHT,
}
Explainer Api automatically transform coordinates between systems, user need to care only abut user coordinate system.
BOTTOM_RIGHT example:
# Z Axis
Under construction