Namespace: getPoints

Player~Player.getPoints(arrayFuncs, optionsPointsopt)

Get array of THREE.Vector4 points.
Parameters:
Name Type Attributes Description
arrayFuncs THREE.Vector4 | THREE.Vector3 | THREE.Vector2 | object | array points.geometry.attributes.position array
THREE.Vector4: 4D point.
THREE.Vector3: 3D point. w = 1. Default is white color
THREE.Vector2: 2D point. w = 1, z = 0. Default is white color
Vector's x, y, z, w is position of the point.
Can be as:
  • float - position of the point.
  • Example: 0.5
  • [float] - array of positions of the point.
  • Example 1: [0.6, 0, -0.5] 0.6 is positon for t = min is start time of the playing. 0 is position for t = ( max - min ) / 2 -0.5 is positon for t = max is stop time of the playing. If stop time of the playing is infinity, then position is equal to the first item of the array or 0.6 in the example 1. Example 2: [{ t: 0, v: 0.6 }, { t: 1, v: -0.6 }] Every item of array is object with: t is time v is position for current t.
  • Function - position of the point is function of the t. Example: new Function( 't', 'a', 'b', 'return Math.sin(t*a*2*Math.PI)*0.5+b' )
  • string - text of the function. Example: 'Math.sin(t*a*2*Math.PI)*0.5+b' )
Vector.w is index of the palette. Default range of the Vector.w is from 0 to 1. You can change range by use an object: { func: Vector.w max: new max value of tne Vector.w min: new min value of tne Vector.w } Example: { func: new Function( 't', 'return 1-2*t' ), min: -1, max: 1, } Vector.w can be as THREE.Color. Example: new THREE.Color( "rgb(255, 127, 0)" ) object: { vector: THREE.Vector4|THREE.Vector3|THREE.Vector2 - point position [name]: point name. Default is undefined. [trace]: true - displays the trace of the point movement. Default is undefined. //You can set the camera to look at a point. Use cameraTarget key for it. //ATTENTION!!! Only one point can have cameraTarget key! // You will receive the // Player.getPoints: duplicate cameraTarget // console warning if two or more points have cameraTarget key. // Then only last point with cameraTarget key will be have an effect. [cameraTarget]: { camera: camera, //rotation camera around point specified by an axis and an angle. Default is undefined - no rotation [rotation]: { [angle]: number|function|array. Angle of rotation in radians. number. Example: Math.PI / 2 rotate to 90 degrees. function. Example: new Function( 't', 'return 5*t' ). array. Example 1: [0, Math.PI] 0 is angle for t = min is start time of the playing. Math.PI is rotate to 180 degrees for t = max is time of the stopping of the playing. If max time is infinity, then angle is for t = min. Example 2: [{ t: 0, v: 0 }, { t: 1, v: Math.PI / 2 } t is time, v is angle for current t. Default is 0 [axis]: THREE.Vector3. Axis of rotattion. Example: new THREE.Vector3( 1, 0, 0 ) - rotate around x axis. Default is new THREE.Vector3( 0, 1, 0 );//Rotate around y axis }, [distanceToCamera]: THREE.Vector3. Distance from point to camera. You can set the distance to the camera depending on the time. Example 1: new THREE.Vector3( 0, 0, new Function( 't', 'return 2+t' ) ) Example 2: new THREE.Vector3( 0, 0, [{ t: 0, v: 5 }, { t: 1, v: 2 }, { t: 10, v: 2 }, { t: 11, v: 5 }] ) Default is camera.position. [orbitControls]: OrbitControls. Change the OrbitControl setting during playing. [orbitControlsGui]: OrbitControlsGui instance; }, //Use controls on the web page for display and edit of the point values. [controllers]: { pointName: HTML element or id of element for point name //axisName is "x" or "y" or "z" or "w" [axisName]: { //Function text controller func: { controller: HTMLElement - input element of function text or string - id of the input element. Default id is "[axisName]Func". Example: "xFunc". elName: HTMLElement - span element of the function name or string - id of the span element. Default id is "[axisName]FuncName". Example: "xFuncName". or false - name element is not exists. } //Point position controller position: { controller: HTMLElement - input element of the point position or string - id of the input element. Default id is "[axisName]Position". Example: "xPosition". elName: HTMLElement - span element of the point position name or string - id of the span element. Default id is "[axisName]PositionName". Example: "xPositionName". or false - name element is not exists. } //World point position controller. worldPosition: { controller: HTMLElement - input element of the world point position or string - id of the input element. Default id is "[axisName]WorldPosition". Example: "xWorldPosition". elName: HTMLElement - span element of the world point position name or string - id of the span element. Default id is "[axisName]WorldPositionName". Example: "xWorldPositionName". or false - name element is not exists. } } }, } or object: { x: x axis. Defauilt is 0. y: y axis. Defauilt is 0. z: z axis. Defauilt is 0. w: w axis. Defauilt is 0. } array: [ 0: x axis. Defauilt is 0. 1: y axis. Defauilt is 0. 2: z axis. Defauilt is 0. 3: w axis. Defauilt is 0. ]
optionsPoints object <optional>
followed optionsPoints is available
Properties
Name Type Attributes Default Description
group THREE.Group <optional>
Group or Scene. Use only if you want trace lines during playing. See trace of the arrayFuncs param above.
t number <optional>
0 first parameter of the arrayFuncs item function. Start time of animation.
options object <optional>
the following options are available
Properties
Name Type Attributes Default Description
a number <optional>
1 multiplier. Second parameter of the arrayFuncs item function.
b number <optional>
0 addendum. Third parameter of the arrayFuncs item function.
playerOptions object <optional>
See settings.options.playerOptions parameter of the Player class.
Source:
Returns:
array of THREE.Vector4 points.