mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-27 22:45:25 +00:00
added some structure files
This commit is contained in:
3
Catalogue/Scripts/colourToText.js
Normal file
3
Catalogue/Scripts/colourToText.js
Normal file
@@ -0,0 +1,3 @@
|
||||
function colourToText(colour) {
|
||||
return "rgb(" + colour[0] + "," + colour[1] + "," + colour[2] + ")"
|
||||
}
|
4
Catalogue/Scripts/degToRad.js
Normal file
4
Catalogue/Scripts/degToRad.js
Normal file
@@ -0,0 +1,4 @@
|
||||
function rad(degrees) {
|
||||
var pi = Math.PI;
|
||||
return degrees * (pi / 180);
|
||||
}
|
10
Catalogue/Scripts/lerp.js
Normal file
10
Catalogue/Scripts/lerp.js
Normal file
@@ -0,0 +1,10 @@
|
||||
function LerpRGB(a, b, t) {
|
||||
if (t < 0) {
|
||||
t *= -1;
|
||||
}
|
||||
var newColor = [0, 0, 0];
|
||||
newColor[0] = a[0] + (b[0] - a[0]) * t;
|
||||
newColor[1] = a[1] + (b[1] - a[1]) * t;
|
||||
newColor[2] = a[2] + (b[2] - a[2]) * t;
|
||||
return newColor;
|
||||
}
|
44
Catalogue/template.html
Normal file
44
Catalogue/template.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- ahhh -->
|
||||
<body>
|
||||
<canvas
|
||||
id="myCanvas"
|
||||
width="1920"
|
||||
height="1080"
|
||||
style="border: 1px solid #d3d3d3"
|
||||
>
|
||||
Your browser does not support the HTML5 canvas tag.</canvas
|
||||
>
|
||||
<script>
|
||||
let c = document.getElementById("myCanvas");
|
||||
let ctx = c.getContext("2d");
|
||||
|
||||
|
||||
let deg_per_sec = 30;
|
||||
let time = 120;
|
||||
let fps = 60;
|
||||
|
||||
centerX = 1920 / 2;
|
||||
centerY = 1080 / 2;
|
||||
|
||||
j = 0;
|
||||
i = 0;
|
||||
|
||||
|
||||
function render() {
|
||||
if (i < time / (1 / fps)) {
|
||||
setTimeout(() => {
|
||||
render();
|
||||
|
||||
render_clear();
|
||||
}, 1000 / fps);
|
||||
j += (deg_per_sec * 1) / fps; //What is this?
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
render();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user