labelling Module
A Position is a spatial location within a Viewer.
Overview
A Position provides its coordinates in each of BIMSurfer's five coordinate systems:
- pos - 3D coordinates within the Position's local Model coordinate system.
- worldPos - 3D coordinates within the Viewer's current World coordinate system, after transformation by the Position's modelling matrix.
- viewPos - 3D coordinates within the Viewer's current View coordinate system, after transformation by the Viewer's view matrix.
- projPos - 3D coordinates within the Viewer's current Projection coordinate system, after transformation by the Viewer's projection matrix.
- canvasPos - 2D coordinates within the Viewer's current Canvas coordinate system.
Example
// Create a Viewer
var viewer = new BIMSURFER.Viewer({ element: "myDiv" });
// Create a Camera
var camera = new BIMSURFER.Camera(viewer, {
eye: [20, 20, -20]
});
// Create a CameraControl to interact with the Camera
var cameraControl = new BIMSURFER.CameraControl(viewer, {
camera: camera
});
// Create a Position
new BIMSURFER.Position(viewer, {
pos: [0,0,0],
matrix: BIMSURFER.math.translationMat4v([4, 0,0])
});