Update: CC - Demo New - Before Render (wlw063ovw9.js) 155 bytes modified

beta.r3js.org
-=yb4f310 2018-02-16 12:15:28 +01:00
parent 348aaab458
commit 7ffda44b05
1 changed files with 22 additions and 11 deletions

View File

@ -4,12 +4,16 @@ if (!this.entityLoaded) {
if (!this.initialized) {
/**
* attributeData hols the new attribute data we want to animate to
*/
this.animate = false;
this.currentAttributeData = null;
this.freshAttributeData = null;
this.attributeData = null;
this.camera = this.entityLoaded.camera;
this.update = [];
this.time = 0;
this.initialized = true;
@ -17,15 +21,22 @@ if (!this.initialized) {
this.time += 0.1 * data.delta;
this.camera.position.x = Math.sin(this.time) * 40;// * (window.innerWidth - (window.innerWidth / 2));
this.camera.position.y = Math.sin(this.time / 2) * 40;//Math.cos(this.time) * (window.innerHeight - (window.innerHeight / 2));
this.camera.position.z = 150 + Math.sin(this.time) * 50;//Math.sin(this.camera.position.y) * Math.cos(this.camera.position.x);
this.camera.updateInstance('position');
if (this.animate) {
this.camera.lookAt.x = 0;
this.camera.lookAt.y = 0;
this.camera.lookAt.z = 0;
this.camera.updateInstance('lookAt');
this.time = 0;
this.generateAnimationVectors();
}
//this.camera.position.x = 10;Math.sin(this.time) * 4;// * (window.innerWidth - (window.innerWidth / 2));
//this.camera.position.y = 10;Math.sin(this.time / 2) * 4;//Math.cos(this.time) * (window.innerHeight - (window.innerHeight / 2));
//this.camera.position.z = 10;-Math.sin(this.time) * 5;//Math.sin(this.camera.position.y) * Math.cos(this.camera.position.x);
//this.camera.updateInstance('position');
//this.camera.lookAt.x = 0;
//this.camera.lookAt.y = 0;
//this.camera.lookAt.z = 0;
//this.camera.updateInstance('lookAt');
// if (this.audioDrone.volume < 0.1) {
// this.audioDrone.volume += 0.001;