ThreeJS Interpolant

CubicInterpolant

Code Example

const interpolant = new THREE.CubicInterpolant(

new Float32Array( 2 ),

new Float32Array( 2 ),

1,

new Float32Array( 1 )

);


interpolant.evaluate( 0.5 );

Constructor

CubicInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer )

parameterPositions -- array of positions

sampleValues -- array of samples

sampleSize -- number of samples

resultBuffer -- buffer to store the interpolation results.

Properties

.parameterPositions : null

.resultBuffer : null

.sampleValues : null

.settings : Object

.valueSize : null

Methods

.evaluate ( t : Number ) : Array

Evaluate the interpolant at position t.

DiscreteInterpolant

Code Example

const interpolant = new THREE.DiscreteInterpolant(

new Float32Array( 2 ),

new Float32Array( 2 ),

1,

new Float32Array( 1 )

);


interpolant.evaluate( 0.5 );

Constructor

DiscreteInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer )

parameterPositions -- array of positions

sampleValues -- array of samples

sampleSize -- number of samples

resultBuffer -- buffer to store the interpolation results.

Properties

.parameterPositions : null

.resultBuffer : null

.sampleValues : null

.settings : Object

.valueSize : null

Methods

.evaluate ( t : Number ) : Array

Evaluate the interpolant at position t.

LinearInterpolant

Code Example

const interpolant = new THREE.LinearInterpolant(

new Float32Array( 2 ),

new Float32Array( 2 ),

1,

new Float32Array( 1 )

);


interpolant.evaluate( 0.5 );

Constructor

LinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer )

parameterPositions -- array of positions

sampleValues -- array of samples

sampleSize -- number of samples

resultBuffer -- buffer to store the interpolation results.

Properties

.parameterPositions : null

.resultBuffer : null

.sampleValues : null

.settings : Object

.valueSize : null

Methods

.evaluate ( t : Number ) : Array

Evaluate the interpolant at position t.

QuaternionLinearInterpolant

Code Example

const interpolant = new THREE.QuaternionLinearInterpolant(

new Float32Array( 2 ),

new Float32Array( 2 ),

1,

new Float32Array( 1 )

);


interpolant.evaluate( 0.5 );

Constructor

QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer)

parameterPositions -- array of positions

sampleValues -- array of samples

sampleSize -- number of samples

resultBuffer -- buffer to store the interpolation results.

Properties

.parameterPositions : null

.resultBuffer : null

.sampleValues : null

.settings : Object

.valueSize : null

Methods

.evaluate ( t : Number ) : Array

Evaluate the interpolant at position t.


Related Topics

ThreeJS Loader 1

AnimationLoader Class for loading AnimationClips in JSON format. This uses the FileLoader internally for loading files. Code Example // instantiate a loader const loader = new THREE.AnimationLoader(); // load a resource loader.load( // resource URL 'animations/animation.js', // onLoad callback function...

8 minutes read.

ThreeJS Audio

It is used to create a non-positional (global ) audio object. Code Example: // create an AudioListener and add it to the camera const listener = new THREE.AudioListener(); camera.add( listener ); // create a global...

6 minutes read.

ThreeJS Geometries-1

BoxGeometry BoxGeometry is a geometry class for a rectangular cuboid with a given 'width', 'height', and 'depth'. On creation, the cuboid is centered on the origin, with each edge parallel to...

7 minutes read.

ThreeJS Objects

Bone A bone that is part of a Skeleton. The skeleton in turn is used by the SkinnedMesh. Bones are almost identical to a blank Object3D. Code Example const root = new THREE.Bone(); const...

12 minutes read.

ThreeJS AnimationAction

AnimationActions are used to schedule the playback of animations saved in AnimationClips. Note that the majority of AnimationAction's methods can be chained together. The "Animation System" page in the "Next Steps" part...

6 minutes read.

ThreeJS Helpers 2

PolarGridHelper The PolarGridHelper is an object to define polar grids. Grids are two-dimensional arrays of lines. Code Example const radius = 10; const radials = 16; const circles = 8; const divisions = 64; const helper =...

4 minutes read.

ThreeJS Keyframe Track

A KeyframeTrack is a timed series of keyframes that are made up of lists of times and related values and are used to animate an object's unique property. The "Animation System"...

4 minutes read.

ThreeJS Object3D

This is the base class for most three.js objects, and it provides a set of properties and methods for manipulating objects in 3D space. It should be noted that this can...

9 minutes read.

ThreeJS Cameras

ArrayCamera ArrayCamera can be used to render a scene using a preset group of cameras quickly. This is an important feature of VR scene rendering performance. An array of sub cameras is...

6 minutes read.

ThreeJS Materials 3

RawShaderMaterial This class works just like ShaderMaterial, except that definitions of built-in uniforms and attributes are not automatically prepended to the GLSL shader code. Code Example const material = new THREE.RawShaderMaterial( {    ...

9 minutes read.

ThreeJS Managers

DefaultLoadingManager When no custom manager is specified, most loaders use a global instance of the LoadingManager. This will suffice for most purposes, but there may be times when you want separate loading...

4 minutes read.

ThreeJS Uniform

Uniforms are global GLSL variables. They are passed to shader programs. Code Example When declaring a uniform of a ShaderMaterial, it is declared by value or by object. uniforms: { time: { value: 1.0...

2 minutes read.

ThreeJS Testing with npm

This article explains how to install three.js in a node.js environment so that automated tests may be run. Tests can be done manually or with the help of automated CI...

4 minutes read.

ThreeJS Scenes

Fog This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance. Constructor Fog( color : Integer, near : Float, far : Float ) The color parameter is...

3 minutes read.

ThreeJS Raycaster

This class is intended to help with raycasting. Raycasting is used for a variety of purposes, including mouse picking (determining which objects in 3D space the mouse is over). Code Example const...

4 minutes read.

ThreeJS Layers

A Layers object assigns an Object3D to one or more of the 32 layers numbered 0 to 31 - the layers are internally stored as a bit mask, and all...

1 minute read.

ThreeJS Renderers

WebGLMultipleRenderTargets A special render target that enables a fragment shader to write to several textures. This approach is useful for advanced rendering techniques like post-processing or deferred rendering. Heads up: WebGLMultipleRenderTargets...

15 minutes read.

ThreeJS Property Binding and Mixer

PropertyBinding Internally, this holds a reference to real property in the scene graph. Constructor PropertyBinding( rootNode : Object3D, path, parsedPath ) -- rootNode: -- path -- parsedPath (optional) Properties The properties are as follows: .path : Number.parsedPath...

2 minutes read.

ThreeJS AnimationClip

An AnimationClip is a group of keyframe tracks that may be reused to depict an animation. The "Animation System" page in the "Next Steps" part of the handbook provides an overview...

2 minutes read.

ThreeJS Creating VR Content

This article gives a quick introduction of the main components of a three.js-based web-based VR application. Workflow      First, you have to include VRButton.js into your project. import { VRButton } from...

1 minute read.