From 67c5cc7c19c85b7e543da9212273bf57d8ca40f4 Mon Sep 17 00:00:00 2001 From: Quinn Date: Sun, 25 Aug 2024 16:25:59 -0400 Subject: [PATCH] Got the animator completed tested and working --- lib/Animator/Animator.h | 1 - lib/Animator/TestFrames.h | 35 ++++++++++++++++++----------------- src/main.cpp | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/Animator/Animator.h b/lib/Animator/Animator.h index 9c5af47..2499150 100644 --- a/lib/Animator/Animator.h +++ b/lib/Animator/Animator.h @@ -238,7 +238,6 @@ V3D Animator::noFillInterpolate(const AnimationFrame &keyF template &BOARD_DIMS> V3D Animator::closestColorInterpolate(const AnimationFrame &keyFrame, V3D cubePosition){ - Serial.print("X:" + String(cubePosition.x) + ",Y:" + String(cubePosition.y) + ",Z:" + String(cubePosition.z)); V3D returnColor{keyFrame.frame[0].color}; V3D distance{keyFrame.frame[0].position}; distance -= cubePosition; diff --git a/lib/Animator/TestFrames.h b/lib/Animator/TestFrames.h index 5312dd7..4a3e2b4 100644 --- a/lib/Animator/TestFrames.h +++ b/lib/Animator/TestFrames.h @@ -30,8 +30,8 @@ namespace TestFrames{ AnimationFrame noFillFrame{ .frame = { CreateCell(0,0,0,red), - // CreateCell(0.5,0.5,0,green), - CreateCell(1,1,0,blue) + CreateCell(0.5,0.5,0.5,green), + CreateCell(1,1,1,blue) }, .fillInterpolation = FillInterpolation::NO_FILL, .frameInterpolation = FrameInterpolation::SNAP, @@ -41,8 +41,8 @@ namespace TestFrames{ AnimationFrame closestColorFrame{ .frame = { CreateCell(0,0,0,red), - // CreateCell(0.5,0.5,0,green), - CreateCell(1,1,0,blue) + CreateCell(0.5,0.5,0.5,green), + CreateCell(1,1,1,blue) }, .fillInterpolation = FillInterpolation::CLOSEST_COLOR, .frameInterpolation = FrameInterpolation::SNAP, @@ -52,8 +52,8 @@ namespace TestFrames{ AnimationFrame linearFillFrame{ .frame = { CreateCell(0,0,0,red), - // CreateCell(0.5,0.5,0,green), - CreateCell(1,1,0,blue) + CreateCell(0.5,0.5,0.5,green), + CreateCell(1,1,1,blue) }, .fillInterpolation = FillInterpolation::LINEAR_WEIGHTED_DISTANCE, .frameInterpolation = FrameInterpolation::SNAP, @@ -63,8 +63,8 @@ namespace TestFrames{ AnimationFrame squareFillFrame{ .frame = { CreateCell(0,0,0,red), - // CreateCell(0.5,0.5,0,green), - CreateCell(1,1,0,blue) + CreateCell(0.5,0.5,0.5,green), + CreateCell(1,1,1,blue) }, .fillInterpolation = FillInterpolation::SQUARE_WEIGHTED_DISTANCE, .frameInterpolation = FrameInterpolation::SNAP, @@ -74,8 +74,8 @@ namespace TestFrames{ AnimationFrame noFillFadeFrame{ .frame = { CreateCell(0,0,0,red), - // CreateCell(0.5,0.5,0,green), - CreateCell(1,1,0,blue) + CreateCell(0.5,0.5,0.5,green), + CreateCell(1,1,1,blue) }, .fillInterpolation = FillInterpolation::NO_FILL, .frameInterpolation = FrameInterpolation::FADE, @@ -85,8 +85,8 @@ namespace TestFrames{ AnimationFrame closestColorFadeFrame{ .frame = { CreateCell(0,0,0,red), - // CreateCell(0.5,0.5,0,green), - CreateCell(1,1,0,blue) + CreateCell(0.5,0.5,0.5,green), + CreateCell(1,1,1,blue) }, .fillInterpolation = FillInterpolation::CLOSEST_COLOR, .frameInterpolation = FrameInterpolation::FADE, @@ -96,8 +96,8 @@ namespace TestFrames{ AnimationFrame linearFillFadeFrame{ .frame = { CreateCell(0,0,0,red), - // CreateCell(0.5,0.5,0,green), - CreateCell(1,1,0,blue) + CreateCell(0.5,0.5,0.5,green), + CreateCell(1,1,1,blue) }, .fillInterpolation = FillInterpolation::LINEAR_WEIGHTED_DISTANCE, .frameInterpolation = FrameInterpolation::FADE, @@ -107,8 +107,8 @@ namespace TestFrames{ AnimationFrame squareFillFadeFrame{ .frame = { CreateCell(0,0,0,red), - // CreateCell(0.5,0.5,0,green), - CreateCell(1,1,0,blue) + CreateCell(0.5,0.5,0.5,green), + CreateCell(1,1,1,blue) }, .fillInterpolation = FillInterpolation::SQUARE_WEIGHTED_DISTANCE, .frameInterpolation = FrameInterpolation::FADE, @@ -123,7 +123,8 @@ namespace TestFrames{ noFillFadeFrame, // 4 closestColorFadeFrame, // 5 linearFillFadeFrame, // 6 - squareFillFadeFrame // 7 + squareFillFadeFrame, // 7 + noFillFrame // 8 }; AnimationFrame testFrame1{ diff --git a/src/main.cpp b/src/main.cpp index c27de7d..52fe41e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -197,7 +197,7 @@ void setup() { Serial.println("Beginning Board Initializaiton"); boardManager.Init(); animator.SetLoop(true); - animator.StartAnimation(&(TestFrames::testAnimationSequence1)); + animator.StartAnimation(&(TestFrames::testAnimationSequence2)); xTaskCreate(UpdateBoard, "UpdateBoard", 10000, NULL, 0, &updateBoardTask); Serial.println("Setup Complete");