How to use the Clock function from three

Find comprehensive JavaScript three.Clock code examples handpicked from public code repositorys.

37
38
39
40
41
42
43
44
45
46
        this.convertThreeTypeModelToThree(this.get('clip'), 'clip'),
        rootObj
    );
    rootObj.animations = (rootObj.animations || []);
    rootObj.animations.push(result);
    this.timer = new THREE.Clock();
    return Promise.resolve(result);
}

play() {
fork icon185
star icon866
watch icon40

+ 3 other calls in file

26
27
28
29
30
31
32
33
34
35

let renderer = new THREE.WebGLRenderer({ canvas: canvas, antialias: true });
let scene = new THREE.Scene();
let camera = window.getViewMatrix ? new HolographicCamera() : new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.01, 1000);
let raycaster = new THREE.Raycaster();
let clock = new THREE.Clock();
let loader = new THREE.TextureLoader();
let material = new THREE.MeshStandardMaterial({ vertexColors: THREE.VertexColors, map: new THREE.DataTexture(new Uint8Array(3).fill(255), 1, 1, THREE.RGBFormat) });

let ambientLight = new THREE.AmbientLight(0xFFFFFF, 0.8);
fork icon10
star icon53
watch icon4

115
116
117
118
119
120
121
122
123
124

        }

        this.copyPass = new THREE.ShaderPass(THREE.CopyShader);

        this.clock = new THREE.Clock();

};

Object.assign(THREE.EffectComposer.prototype, {
fork icon9
star icon22
watch icon2

17
18
19
20
21
22
23
24
25
26
  antialias: true,
  canvas: canvas,
});
const scene = new THREE.Scene();
const camera = new ForceCamera(35, window.innerWidth / window.innerHeight, 1, 10000);
const clock = new THREE.Clock();

//
// process for this sketch.
//
fork icon260
star icon0
watch icon0

+ 3 other calls in file

280
281
282
283
284
285
286
287
288
289

renderer.toneMappingExposure = Math.pow(0.7, 2.0);

renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
var clock = new THREE.Clock();

function animate() {

    requestAnimationFrame( animate );
fork icon26
star icon28
watch icon0

+ 2 other calls in file

8
9
10
11
12
13
14
15
16
17

(function() {
    'use strict'

    var camera, tick = 0,
        scene, renderer, clock = new THREE.Clock(true),
        controls;

    var backgroundScene;
    var backgroundCamera;
fork icon5
star icon23
watch icon3

+ 2 other calls in file

175
176
177
178
179
180
181
182
183
184

  const animationClip = new THREE.AnimationClip(null, 5, [track]);
  const animationAction = mesh.userData.mixer.clipAction(animationClip);
  animationAction.setLoop(THREE.LoopOnce);
  animationAction.play();
  mesh.userData.clock = new THREE.Clock();
  animations.push(mesh);
};

function createFireballMesh (type = 1) {
fork icon1
star icon1
watch icon0

+ 35 other calls in file

10
11
12
13
14
15
16
17
18
19
global.THREE = THREE;

var width = window.innerWidth;
var height = window.innerHeight;

var clock = new THREE.Clock(true);
var scene = new THREE.Scene();
var renderer = new THREE.WebGLRenderer();
renderer.setClearColor(0xf0f0f0);
renderer.setPixelRatio(window.devicePixelRatio);
fork icon0
star icon3
watch icon2

+ 5 other calls in file

56
57
58
59
60
61
62
63
64
65

var showOther = false
document.body.addEventListener('keypress', () => {
        showOther = !showOther
})
var clock = new THREE.Clock()
scene1.updateMatrixWorld()
var portalBox = new THREE.Box3().setFromObject(scene1.portal)
var helper = new THREE.BoundingBoxHelper(scene1.portal)
helper.update()
fork icon0
star icon1
watch icon2

30
31
32
33
34
35
36
37
38
39
let style
let startedSimulation = false
let isRendering = false
let shouldShowFluidOutline = false
let fountainWorld
let clock = new THREE.Clock()

const SVGLoader = require('three/examples/jsm/loaders/SVGLoader').SVGLoader

const svgLoader = new SVGLoader()
fork icon2
star icon3
watch icon1

75
76
77
78
79
80
81
82
83
boidManager.boids.forEach(boid => {
  scene.add(boid.mesh)
})

// CLOCK
clock = new THREE.Clock();

var axesHelper = new THREE.AxesHelper(50);
scene.add(axesHelper);
fork icon2
star icon5
watch icon0

25
26
27
28
29
30
31
32
33
34
leftVisible: true,
rightVisible: true,

toggleTextures: false,

clock: new THREE.Clock(),
conditions: {
    path: './data/conditions.json',
    downloading: null,
    loading: null,
fork icon1
star icon1
watch icon0

28
29
30
31
32
33
34
35
36
  this.exitButton.addEventListener('click', () => this.exitVR())

  window.addEventListener('resize', () => this.resize());
  window.addEventListener('vrdisplaypresentchange', () => this.vrDisplayPresentChange());

  this.clock = new THREE.Clock( true );

  this.resize();
}
fork icon0
star icon1
watch icon1

19
20
21
22
23
24
25
26
27
28

let renderer = undefined;
let currentScene = undefined;

//myGezincGeometriestains a tuple of the threejs mesh, timeEnabled, morphColour flag, unique id and morph
const clock = new THREE.Clock(false);
this.playAnimation = true;
 /* default animation update rate, rate is 1000 and duration 
   is default to 6000, 6s to finish a full animation */
let playRate = 1000;
fork icon9
star icon3
watch icon0

29
30
31
32
33
34
35
36
37
38
this.tilesAmountHorizontally = tilesAmountHorizontally;
this.tilesAmountVertically = tilesAmountVertically;
this.tilesTotalAmount = tilesTotalAmount;
this.currentFrameDisplayTime = 0;
this.currentFrame = 0;
this.clock = new three_1.Clock();
this.end$ = new rxjs_1.Subject();
this.tilesTotalAmount -= 1; // indexing from 0
this.frameDisplayDuration = 1000 / framesPerSecond;
this.texture.wrapS = three_1.RepeatWrapping;
fork icon8
star icon63
watch icon0

16
17
18
19
20
21
22
23
24
25
  antialias: true,
  canvas: canvas,
});
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera();
const clock = new THREE.Clock({
  autoStart: false
});

camera.far = 1000;
fork icon0
star icon0
watch icon0

222
223
224
225
226
227
228
229
230
231
var myScene = {
	camLevel: 0,
	scene: new THREE.Scene(),
	carousels: null,
	loaded: false,
	clock: new THREE.Clock(), // instantiates a clock to use for getting the time delta between frames to calculate animations
	bboxMat: new THREE.MeshLambertMaterial(), // Bbox material  
	initialColor: new THREE.Color().setRGB( 0.0, 0.0, 0.0 ),
	hoverColor: new THREE.Color().setRGB( 0.2, 0.2, 0.2 ),
	clickColor: new THREE.Color().setRGB( 0.15, 0.15, 0.2 ),
fork icon0
star icon0
watch icon0

+ 2 other calls in file

77
78
79
80
81
82
83
84
85
86
}); // console.log(this.startGeometry);
// 创建烟花点球

this.startPoint = new Three.Points(this.startGeometry, this.startMaterial); // 开始计时

this.clock = new Three.Clock(); // 创建爆炸的烟花

this.fireworkGeometry = new Three.BufferGeometry();
this.FireworksCount = 180 + Math.floor(Math.random() * 180);
var positionFireworksArray = new Float32Array(this.FireworksCount * 3);
fork icon0
star icon0
watch icon0

+ 3 other calls in file

7
8
9
10
11
12
13
14
15
16
17
18
import Audio from './audio'
// import Sparkle from './postprocessing/sparkle'
import Rainbow from './postprocessing/rainbow'
import Window from './postprocessing/window'


var clock = new THREE.Clock(false);


var scene
var camera
var renderer
fork icon0
star icon0
watch icon0

240
241
242
243
244
245
246
247
248
249
      // フェードインの処理がほしい //
      sound.play();
    }
  }
}); // クロックはラジアンと同じ効力をもたらす// let theta = clock.getElapsedTime(); loader.camera.position.x = 5 * Math.sin(theta);
// const clock = new THREE.Clock();
// console.log(loader);

var hasBoolPos = true;
var mouseCount = 0;
fork icon0
star icon0
watch icon0

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)