Class Projector

Projects points between spaces.

Index

Constructor methods

Methods

Constructor methods

constructor(): Projector

Returns

Projector

Methods

public pickingRay(vector: Vector3, camera: Camera): Raycaster

Translates a 2D point from NDC (Normalized Device Coordinates) to a Raycaster that can be used for picking. NDC range from [-1..1] in x (left to right) and [1.0 .. -1.0] in y (top to bottom).

Parameters

Returns

Raycaster

public projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): { objects: THREE.Object3D[]; sprites: THREE.Object3D[]; lights: THREE.Light[]; elements: THREE.Face3[]; }

Transforms a 3D scene object into 2D render data that can be rendered in a screen with your renderer of choice, projecting and clipping things out according to the used camera. If the scene were a real scene, this method would be the equivalent of taking a picture with the camera (and developing the film would be the next step, using a Renderer).

Parameters

  • scene: Scene

    scene to project.

  • camera: Camera

    camera to use in the projection.

  • sortObjects: boolean
  • sortElements?: boolean optional

Returns

{ objects: THREE.Object3D[]; sprites: THREE.Object3D[]; lights: THREE.Light[]; elements: THREE.Face3[]; }

public projectVector(vector: Vector3, camera: Camera): Vector3

Parameters

Returns

Vector3

public unprojectVector(vector: Vector3, camera: Camera): Vector3

Parameters

Returns

Vector3