Projection.project

Syntax

project(v: PP.Vector3);

Parameters

v. Vector.

Description

The project method transforms world coordinates of vector to screen ones.

Comments

Screen coordinates are transformed into world coordinates by means of the unProject method.

Example

To execute the example the HTML page must contain the MapChart component map (see Example of Creating the MapChart Component). Open a spherical map. Get screen coordinates of vector with the world coordinates (10, 10, 10):

// Get class object used to work with 3D projection
var projection = map.getGLControl().getProjection();
// Get ray direction from point
var vector = projection.project(new PP.Vector3(10, 10, 10));
console.log("X coordinates of vector: " + vector.getX());
console.log("Y coordinate of vector: " + vector.getY());
console.log("Z coordinate of vector: " + vector.getZ());

As a result the console displays vector coordinates:

X coordinate of vector: -2018.5043397046127

Y coordinate of vector: 2702.0043429156012

Z coordinate of vector: 1.0001132475542702

See also:

Projection