[CT404]: Lint Week 3 lecture examples

This commit is contained in:
2024-09-27 21:27:30 +01:00
parent 65eb318882
commit 38b9e2f2b2
9 changed files with 572 additions and 549 deletions

View File

@ -1,5 +1,6 @@
<html>
<head>
<head>
<script src="three.js"></script>
<script src="OrbitControls.js"></script>
@ -15,20 +16,20 @@
function draw() {
// create renderer attached to HTML Canvas object
var c = document.getElementById("canvas");
renderer = new THREE.WebGLRenderer({ canvas: c, antialias: true });
renderer = new THREE.WebGLRenderer({canvas: c, antialias: true});
// create the scenegraph
scene = new THREE.Scene();
// create a camera
var fov = 75;
var aspect = 600/600;
var aspect = 600 / 600;
var near = 0.1;
var far = 1000;
camera = new THREE.PerspectiveCamera( fov, aspect, near, far );
camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 0, 40);
orbitcontrols = new THREE.OrbitControls (camera, c);
orbitcontrols = new THREE.OrbitControls(camera, c);
orbitcontrols.enableDamping = true;
orbitcontrols.dampingFactor = 0.25;
orbitcontrols.enableZoom = true;
@ -37,7 +38,7 @@
// point light and wireframe marker to indicate position
pointLight = new THREE.PointLight(0xFFFFFF);
var wfMaterial = new THREE.LineBasicMaterial({color: 0xffffff, linewidth: 2});
var markergeometry = new THREE.EdgesGeometry(new THREE.SphereGeometry(0.5,10,10));
var markergeometry = new THREE.EdgesGeometry(new THREE.SphereGeometry(0.5, 10, 10));
var pointlightmarker = new THREE.LineSegments(markergeometry, wfMaterial);
pointLight.add(pointlightmarker);
pointLight.position.set(-10, 20, 0);
@ -64,31 +65,31 @@
// args: radius, widthSegments, heightSegments
// FLAT SHADING is achieved in Threejs using MeshPhongMaterial with flatShading set to true
var material1 = new THREE.MeshPhongMaterial({color: 0xff0000, flatShading:true});
var sphere1 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), material1);
sphere1.position.set(-20,0,0);
var material1 = new THREE.MeshPhongMaterial({color: 0xff0000, flatShading: true});
var sphere1 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), material1);
sphere1.position.set(-20, 0, 0);
scene.add(sphere1);
// SMOOTH SHADING is the default setting for MeshLambertMaterial
var sphere2 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), new THREE.MeshLambertMaterial({color: 0xffff00}));
sphere2.position.set(0,0,0);
var sphere2 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), new THREE.MeshLambertMaterial({color: 0xffff00}));
sphere2.position.set(0, 0, 0);
scene.add(sphere2);
// NORMAL-INTERPOLATING SHADING is the default for MeshPhongMaterial
var sphere3 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), new THREE.MeshPhongMaterial({color: 0x0000ff}));
sphere3.position.set(20,0,0);
var sphere3 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), new THREE.MeshPhongMaterial({color: 0x0000ff}));
sphere3.position.set(20, 0, 0);
scene.add(sphere3);
// the "ground"
var box = new THREE.Mesh(new THREE.BoxGeometry(60, 5, 60), new THREE.MeshLambertMaterial({color: 0x00ff00}));
scene.add(box);
box.position.set(0,-15,0);
box.position.set(0, -15, 0);
animate();
}
function animate() {
setTimeout(animate, 1000/60);
setTimeout(animate, 1000 / 60);
orbitcontrols.update();
@ -127,9 +128,9 @@
scene.remove(directionalLight);
}
</script>
</head>
</head>
<body onload="draw();">
<body onload="draw();">
<canvas id="canvas" width="600" height="600"></canvas>
<div style="position:absolute; left:20px; top:20px;">
<button onclick="togglePointLight();">PointLight</button>
@ -137,5 +138,6 @@
<button onclick="toggleHemisphereLight();">HemisphereLight</button>
<button onclick="toggleDirectionalLight();">DirectionalLight</button>
</div>
</body>
</body>
</html>

View File

@ -1,5 +1,6 @@
<html>
<head>
<head>
<script src="three.js"></script>
<script src="OrbitControls.js"></script>
@ -13,6 +14,7 @@
// values that we're animating
var mat2hue = 1;
var mat3green = 0;
// animation controller values
var mat2dir = -0.001;
var mat3dir = 0.001;
@ -20,20 +22,20 @@
function draw() {
// create renderer attached to HTML Canvas object
var c = document.getElementById("canvas");
renderer = new THREE.WebGLRenderer({ canvas: c, antialias: true });
renderer = new THREE.WebGLRenderer({canvas: c, antialias: true});
// create the scenegraph
scene = new THREE.Scene();
// create a camera
var fov = 75;
var aspect = 600/600;
var aspect = 600 / 600;
var near = 0.1;
var far = 1000;
camera = new THREE.PerspectiveCamera( fov, aspect, near, far );
camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 0, 40);
orbitcontrols = new THREE.OrbitControls (camera, c);
orbitcontrols = new THREE.OrbitControls(camera, c);
orbitcontrols.enableDamping = true;
orbitcontrols.dampingFactor = 0.25;
orbitcontrols.enableZoom = true;
@ -50,43 +52,43 @@
// args: radius, widthSegments, heightSegments
// FLAT SHADING is achieved in Threejs using MeshPhongMaterial with flatShading set to true
var material1 = new THREE.MeshPhongMaterial({color: 0xff0000, flatShading:true, emissive: 0x003300});
var sphere1 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), material1);
sphere1.position.set(-20,0,0);
var material1 = new THREE.MeshPhongMaterial({color: 0xff0000, flatShading: true, emissive: 0x003300});
var sphere1 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), material1);
sphere1.position.set(-20, 0, 0);
scene.add(sphere1);
// SMOOTH SHADING is the default setting for MeshLambertMaterial
sphere2material = new THREE.MeshLambertMaterial({color: 0xffff00});
var sphere2 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), sphere2material);
sphere2.position.set(0,0,0);
var sphere2 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), sphere2material);
sphere2.position.set(0, 0, 0);
scene.add(sphere2);
// NORMAL-INTERPOLATING SHADING is the default for MeshPhongMaterial
sphere3material = new THREE.MeshPhongMaterial({color: 0x0000ff, specular: 0x00ff00, shininess: 100});
var sphere3 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), sphere3material);
sphere3.position.set(20,0,0);
var sphere3 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), sphere3material);
sphere3.position.set(20, 0, 0);
scene.add(sphere3);
// the "ground"
var box = new THREE.Mesh(new THREE.BoxGeometry(60, 5, 60), new THREE.MeshLambertMaterial({color: 0x00ff00}));
scene.add(box);
box.position.set(0,-15,0);
box.position.set(0, -15, 0);
animate();
}
function animate() {
setTimeout(animate, 1000/60);
setTimeout(animate, 1000 / 60);
orbitcontrols.update();
// animate sphere2material between red and yellow using HSL
mat2hue += mat2dir;
if (mat2hue<=0) {
if (mat2hue <= 0) {
mat2hue = 0;
mat2dir = Math.abs(mat2dir);
}
else if (mat2hue>=0.2) {
else if (mat2hue >= 0.2) {
mat2hue = 0.2;
mat2dir = -Math.abs(mat2dir);
}
@ -94,11 +96,11 @@
// animate sphere3material between red and yellow using RGB
mat3green += mat3dir;
if (mat3green<=0) {
if (mat3green <= 0) {
mat3green = 0;
mat3dir = Math.abs(mat3dir);
}
else if (mat3green>=1) {
else if (mat3green >= 1) {
mat3green = 1;
mat3dir = -Math.abs(mat3dir);
}
@ -107,9 +109,10 @@
renderer.render(scene, camera);
}
</script>
</head>
</head>
<body onload="draw();">
<body onload="draw();">
<canvas id="canvas" width="600" height="600"></canvas>
</body>
</body>
</html>

View File

@ -1,5 +1,6 @@
<html>
<head>
<head>
<script src="three.js"></script>
<script src="OrbitControls.js"></script>
@ -15,7 +16,7 @@
function draw() {
// create renderer attached to HTML Canvas object
var c = document.getElementById("canvas");
renderer = new THREE.WebGLRenderer({ canvas: c, antialias: true });
renderer = new THREE.WebGLRenderer({canvas: c, antialias: true});
// SHADOW CODE ADDED HERE
renderer.shadowMap.enabled = true;
@ -25,13 +26,13 @@
// create a camera
var fov = 75;
var aspect = 600/600;
var aspect = 600 / 600;
var near = 0.1;
var far = 1000;
camera = new THREE.PerspectiveCamera( fov, aspect, near, far );
camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
camera.position.set(0, 0, 40);
orbitcontrols = new THREE.OrbitControls (camera, c);
orbitcontrols = new THREE.OrbitControls(camera, c);
orbitcontrols.enableDamping = true;
orbitcontrols.dampingFactor = 0.25;
orbitcontrols.enableZoom = true;
@ -40,7 +41,7 @@
// point light and wireframe marker to indicate position
pointLight = new THREE.PointLight(0xFFFFFF);
var wfMaterial = new THREE.LineBasicMaterial({color: 0xffffff, linewidth: 2});
var markergeometry = new THREE.EdgesGeometry(new THREE.SphereGeometry(0.5,10,10));
var markergeometry = new THREE.EdgesGeometry(new THREE.SphereGeometry(0.5, 10, 10));
var pointlightmarker = new THREE.LineSegments(markergeometry, wfMaterial);
pointLight.add(pointlightmarker);
pointLight.position.set(-10, 20, 0);
@ -69,23 +70,23 @@
// args: radius, widthSegments, heightSegments
// FLAT SHADING is achieved in Threejs using MeshPhongMaterial with flatShading set to true
var material1 = new THREE.MeshPhongMaterial({color: 0xff0000, flatShading:true});
var sphere1 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), material1);
sphere1.position.set(-20,0,0);
var material1 = new THREE.MeshPhongMaterial({color: 0xff0000, flatShading: true});
var sphere1 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), material1);
sphere1.position.set(-20, 0, 0);
scene.add(sphere1);
sphere1.castShadow = true; // SHADOW CODE ADDED HERE
sphere1.receiveShadow = true; // SHADOW CODE ADDED HERE
// SMOOTH SHADING is the default setting for MeshLambertMaterial
var sphere2 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), new THREE.MeshLambertMaterial({color: 0xffff00}));
sphere2.position.set(0,0,0);
var sphere2 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), new THREE.MeshLambertMaterial({color: 0xffff00}));
sphere2.position.set(0, 0, 0);
scene.add(sphere2);
sphere2.castShadow = true; // SHADOW CODE ADDED HERE
sphere2.receiveShadow = true; // SHADOW CODE ADDED HERE
// NORMAL-INTERPOLATING SHADING is the default for MeshPhongMaterial
var sphere3 = new THREE.Mesh(new THREE.SphereBufferGeometry(7,10,10), new THREE.MeshPhongMaterial({color: 0x0000ff}));
sphere3.position.set(20,0,0);
var sphere3 = new THREE.Mesh(new THREE.SphereBufferGeometry(7, 10, 10), new THREE.MeshPhongMaterial({color: 0x0000ff}));
sphere3.position.set(20, 0, 0);
scene.add(sphere3);
sphere3.castShadow = true; // SHADOW CODE ADDED HERE
sphere3.receiveShadow = true; // SHADOW CODE ADDED HERE
@ -93,14 +94,14 @@
// the "ground"
var box = new THREE.Mesh(new THREE.BoxGeometry(60, 5, 60), new THREE.MeshLambertMaterial({color: 0x00ff00}));
scene.add(box);
box.position.set(0,-15,0);
box.position.set(0, -15, 0);
box.receiveShadow = true; // SHADOW CODE ADDED HERE
animate();
}
function animate() {
setTimeout(animate, 1000/60);
setTimeout(animate, 1000 / 60);
orbitcontrols.update();
@ -139,9 +140,9 @@
scene.remove(directionalLight);
}
</script>
</head>
</head>
<body onload="draw();">
<body onload="draw();">
<canvas id="canvas" width="600" height="600"></canvas>
<div style="position:absolute; left:20px; top:20px;">
<button onclick="togglePointLight();">PointLight</button>
@ -149,5 +150,6 @@
<button onclick="toggleHemisphereLight();">HemisphereLight</button>
<button onclick="toggleDirectionalLight();">DirectionalLight</button>
</div>
</body>
</body>
</html>

View File

@ -1,11 +1,12 @@
<html>
<head>
<head>
<script>
var x=0, y=0;
var dx=4, dy=5;
var x = 0, y = 0;
var dx = 4, dy = 5;
function draw() {
function draw() {
var canvas = document.getElementById("canvas");
var context = canvas.getContext('2d');
@ -13,32 +14,33 @@ function draw() {
// remove previous translation if any
context.save();
// over-write previous content, with a grey rectangle
context.fillStyle="#DDDDDD";
context.fillRect(0,0,600,600);
context.fillStyle = "#DDDDDD";
context.fillRect(0, 0, 600, 600);
// perform movement, and translate to position
x+=dx;
y+=dy;
if (x<=0)
dx=4;
else if (x>=550)
dx=-4;
if (y<=0)
dy=5;
else if (y>=550)
dy=-5;
context.translate(x,y);
x += dx;
y += dy;
if (x <= 0)
dx = 4;
else if (x >= 550)
dx = -4;
if (y <= 0)
dy = 5;
else if (y >= 550)
dy = -5;
context.translate(x, y);
// purple rectangle
context.fillStyle="#CC00FF";
context.fillRect(0,0,50,50);
context.fillStyle = "#CC00FF";
context.fillRect(0, 0, 50, 50);
context.restore();
// do it all again in 1/30th of a second
window.setTimeout("draw();",1000/30);
}
window.setTimeout("draw();", 1000 / 30);
}
</script>
</head>
</head>
<body onload="draw();">
<body onload="draw();">
<canvas id="canvas" width="600" height="600"></canvas>
</body>
</body>
</html>

View File

@ -1,12 +1,12 @@
<html>
<head>
<head>
<script>
var x = 0, y = 0;
var dx = 4, dy = 5;
var now = Date.now();
var x=0, y=0;
var dx=4, dy=5;
var now = Date.now();
function draw() {
function draw() {
// do it all again in 1/60th of a second
window.requestAnimationFrame(draw);
@ -18,30 +18,36 @@ function draw() {
// remove previous translation if any
context.save();
// over-write previous content, with a grey rectangle
context.fillStyle="#DDDDDD";
context.fillRect(0,0,600,600);
// perform movement, and translate to position
x+=dx*elapsedMs/16.7;
y+=dy*elapsedMs/16.7;
if (x<=0)
dx=4;
else if (x>=550)
dx=-4;
if (y<=0)
dy=5;
else if (y>=550)
dy=-5;
context.translate(x,y);
// purple rectangle
context.fillStyle="#CC00FF";
context.fillRect(0,0,50,50);
context.restore();
}
</script>
</head>
<body onload="draw();">
// over-write previous content, with a grey rectangle
context.fillStyle = "#DDDDDD";
context.fillRect(0, 0, 600, 600);
// perform movement, and translate to position
x += dx * elapsedMs / 16.7;
y += dy * elapsedMs / 16.7;
if (x <= 0)
dx = 4;
else if (x >= 550)
dx = -4;
if (y <= 0)
dy = 5;
else if (y >= 550)
dy = -5;
context.translate(x, y);
// purple rectangle
context.fillStyle = "#CC00FF";
context.fillRect(0, 0, 50, 50);
context.restore();
}
</script>
</head>
<body onload="draw();">
<canvas id="canvas" width="600" height="600"></canvas>
</body>
</body>
</html>

View File

@ -1,46 +1,47 @@
<html>
<head>
<script>
var boxes = [];
function attachEvents() {
document.onmousedown = function(event) {
<head>
<script>
var boxes = [];
function attachEvents() {
document.onmousedown = function (event) {
// adds a new box at the mouse position
// step 1: find a spare index in the sparse array
var idx=Math.floor(Math.random()*1000);
while (typeof boxes[idx]!="undefined")
idx=Math.floor(Math.random()*1000);
var idx = Math.floor(Math.random() * 1000);
while (typeof boxes[idx] != "undefined")
idx = Math.floor(Math.random() * 1000);
// step 2: create a new box object and add to the array
// setting up its data properties
boxes[idx]=new Object();
boxes[idx] = new Object();
boxes[idx].x = event.clientX;
boxes[idx].y = event.clientY;
var r = Math.floor(Math.random()*256);
var g = Math.floor(Math.random()*256);
var b = Math.floor(Math.random()*256);
boxes[idx].colr = "rgb("+r+","+g+","+b+")";
boxes[idx].dy = Math.floor(1+Math.random()*8);
var r = Math.floor(Math.random() * 256);
var g = Math.floor(Math.random() * 256);
var b = Math.floor(Math.random() * 256);
boxes[idx].colr = "rgb(" + r + "," + g + "," + b + ")";
boxes[idx].dy = Math.floor(1 + Math.random() * 8);
}
}
}
function draw() {
function draw() {
var canvas = document.getElementById("canvas");
var context = canvas.getContext('2d');
// over-write previous content, with a grey rectangle
context.fillStyle="#DDDDDD";
context.fillRect(0,0,600,600);
context.fillStyle = "#DDDDDD";
context.fillRect(0, 0, 600, 600);
// iterate thru the objects in our sparse array
// the for..in construct obtains *indices* rather than *data values*
for (var idx in boxes) {
var y=boxes[idx].y+boxes[idx].dy; // animate box downwards
if (y<600) {
var y = boxes[idx].y + boxes[idx].dy; // animate box downwards
if (y < 600) {
context.save();
boxes[idx].y=y;
context.translate(boxes[idx].x,y);
context.fillStyle=boxes[idx].colr;
context.fillRect(0,0,20,20);
boxes[idx].y = y;
context.translate(boxes[idx].x, y);
context.fillStyle = boxes[idx].colr;
context.fillRect(0, 0, 20, 20);
context.restore();
}
else
@ -48,12 +49,13 @@ function draw() {
}
// do it all again in 1/30th of a second
window.setTimeout("draw();",1000/30);
}
window.setTimeout("draw();", 1000 / 30);
}
</script>
</head>
</head>
<body onload="attachEvents(); draw();">
<body onload="attachEvents(); draw();">
<canvas id="canvas" width="600" height="600"></canvas>
</body>
</body>
</html>

View File

@ -1,34 +1,38 @@
<html>
<head>
<head>
<script>
function attachEvents() {
document.onkeypress = function(event) {
var xoffset=10*parseInt(String.fromCharCode(event.keyCode || event.charCode));
function attachEvents() {
document.onkeypress = function (event) {
var xoffset = 10 * parseInt(String.fromCharCode(event.keyCode || event.charCode));
draw(xoffset);
}
}
function draw(xoffset) {
}
function draw(xoffset) {
var canvas = document.getElementById("canvas");
var context = canvas.getContext('2d');
// remove previous translation if any
context.save();
// over-write previous content, with a white rectangle
context.fillStyle="#FFFFFF";
context.fillRect(0,0,300,300);
context.fillStyle = "#FFFFFF";
context.fillRect(0, 0, 300, 300);
// translate based on numerical keypress
context.translate(xoffset,0);
context.translate(xoffset, 0);
// purple rectangle
context.fillStyle="#CC00FF";
context.fillRect(0,0,50,50);
context.fillStyle = "#CC00FF";
context.fillRect(0, 0, 50, 50);
context.restore();
}
}
</script>
</head>
</head>
<body onload="attachEvents();">
<body onload="attachEvents();">
<canvas id="canvas" width="300" height="300"></canvas>
</body>
</body>
</html>

View File

@ -1,22 +1,23 @@
<html>
<head>
<head>
<script>
var isMouseDown=false;
function attachEvents() {
document.onmousedown = function(event) {
isMouseDown=true;
var isMouseDown = false;
function attachEvents() {
document.onmousedown = function (event) {
isMouseDown = true;
draw(event.clientX, event.clientY);
}
document.onmouseup = function(event) {
isMouseDown=false;
document.onmouseup = function (event) {
isMouseDown = false;
}
document.onmousemove = function(event) {
if ( isMouseDown ) {
document.onmousemove = function (event) {
if (isMouseDown) {
draw(event.clientX, event.clientY);
}
}
}
function draw(xoffset,yoffset) {
}
function draw(xoffset, yoffset) {
var canvas = document.getElementById("canvas");
var context = canvas.getContext('2d');
@ -24,22 +25,23 @@ function draw(xoffset,yoffset) {
// remove previous translation if any
context.save();
// over-write previous content, with a grey rectangle
context.fillStyle="#DDDDDD";
context.fillRect(0,0,600,600);
context.fillStyle = "#DDDDDD";
context.fillRect(0, 0, 600, 600);
// translate based on position of mouseclick
context.translate(xoffset,yoffset);
context.translate(xoffset, yoffset);
// purple rectangle
context.fillStyle="#CC00FF";
context.fillRect(-25,-25,50,50); // centred on coord system
context.fillStyle = "#CC00FF";
context.fillRect(-25, -25, 50, 50); // centred on coord system
context.restore();
}
}
</script>
</head>
</head>
<body onload="attachEvents(); draw(0,0);">
<body onload="attachEvents(); draw(0,0);">
hello<br>
<div id='canvasdiv' style='position:absolute; left:0px; top:0px;'><canvas id="canvas" width="600" height="600"></canvas></div>
</body>
</html>
<div id='canvasdiv' style='position:absolute; left:0px; top:0px;'><canvas id="canvas" width="600"
height="600"></canvas></div>
</body>
</html>

View File

@ -11,29 +11,29 @@ function orientationInterpolator(data) {
orientationInterpolator.prototype.getEulerAngles = function() {
var now = Date.now();
var elapsed = now-this.startTime;
while (elapsed>=this.data.times[this.keyframe2]) {
var elapsed = now - this.startTime;
while (elapsed >= this.data.times[this.keyframe2]) {
this.keyframe1++;
this.keyframe2++;
if (this.keyframe2>=this.data.times.length) { // loop back to keyframe 0
if (this.keyframe2 >= this.data.times.length) { // loop back to keyframe 0
var timeSinceLastFrame = elapsed - this.data.times[this.keyframe1];
this.startTime = now - timeSinceLastFrame;
this.keyframe1 = 0;
this.keyframe2 = 1;
elapsed = now-this.startTime;
elapsed = now - this.startTime;
}
}
var timeBetweenKeyFrames = this.data.times[this.keyframe2] - this.data.times[this.keyframe1];
var timeSinceKeyframe1 = elapsed - this.data.times[this.keyframe1];
var fractionBetweenFrames = timeSinceKeyframe1/timeBetweenKeyFrames;
var fractionBetweenFrames = timeSinceKeyframe1 / timeBetweenKeyFrames;
var frame1rot = this.data.angles[this.keyframe1];
var frame2rot = this.data.angles[this.keyframe2];
var rot = {
x: frame1rot.x*(1-fractionBetweenFrames) + frame2rot.x*fractionBetweenFrames,
y: frame1rot.y*(1-fractionBetweenFrames) + frame2rot.y*fractionBetweenFrames,
z: frame1rot.z*(1-fractionBetweenFrames) + frame2rot.z*fractionBetweenFrames
x: frame1rot.x * (1 - fractionBetweenFrames) + frame2rot.x * fractionBetweenFrames,
y: frame1rot.y * (1 - fractionBetweenFrames) + frame2rot.y * fractionBetweenFrames,
z: frame1rot.z * (1 - fractionBetweenFrames) + frame2rot.z * fractionBetweenFrames
};
return rot;