Got the animator completed tested and working
This commit is contained in:
@@ -238,7 +238,6 @@ V3D<uint32_t> Animator<BOARD_DIMS>::noFillInterpolate(const AnimationFrame &keyF
|
|||||||
|
|
||||||
template <const V3D<uint32_t> &BOARD_DIMS>
|
template <const V3D<uint32_t> &BOARD_DIMS>
|
||||||
V3D<uint32_t> Animator<BOARD_DIMS>::closestColorInterpolate(const AnimationFrame &keyFrame, V3D<uint32_t> cubePosition){
|
V3D<uint32_t> Animator<BOARD_DIMS>::closestColorInterpolate(const AnimationFrame &keyFrame, V3D<uint32_t> cubePosition){
|
||||||
Serial.print("X:" + String(cubePosition.x) + ",Y:" + String(cubePosition.y) + ",Z:" + String(cubePosition.z));
|
|
||||||
V3D<uint32_t> returnColor{keyFrame.frame[0].color};
|
V3D<uint32_t> returnColor{keyFrame.frame[0].color};
|
||||||
V3D<uint32_t> distance{keyFrame.frame[0].position};
|
V3D<uint32_t> distance{keyFrame.frame[0].position};
|
||||||
distance -= cubePosition;
|
distance -= cubePosition;
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ namespace TestFrames{
|
|||||||
AnimationFrame noFillFrame{
|
AnimationFrame noFillFrame{
|
||||||
.frame = {
|
.frame = {
|
||||||
CreateCell(0,0,0,red),
|
CreateCell(0,0,0,red),
|
||||||
// CreateCell(0.5,0.5,0,green),
|
CreateCell(0.5,0.5,0.5,green),
|
||||||
CreateCell(1,1,0,blue)
|
CreateCell(1,1,1,blue)
|
||||||
},
|
},
|
||||||
.fillInterpolation = FillInterpolation::NO_FILL,
|
.fillInterpolation = FillInterpolation::NO_FILL,
|
||||||
.frameInterpolation = FrameInterpolation::SNAP,
|
.frameInterpolation = FrameInterpolation::SNAP,
|
||||||
@@ -41,8 +41,8 @@ namespace TestFrames{
|
|||||||
AnimationFrame closestColorFrame{
|
AnimationFrame closestColorFrame{
|
||||||
.frame = {
|
.frame = {
|
||||||
CreateCell(0,0,0,red),
|
CreateCell(0,0,0,red),
|
||||||
// CreateCell(0.5,0.5,0,green),
|
CreateCell(0.5,0.5,0.5,green),
|
||||||
CreateCell(1,1,0,blue)
|
CreateCell(1,1,1,blue)
|
||||||
},
|
},
|
||||||
.fillInterpolation = FillInterpolation::CLOSEST_COLOR,
|
.fillInterpolation = FillInterpolation::CLOSEST_COLOR,
|
||||||
.frameInterpolation = FrameInterpolation::SNAP,
|
.frameInterpolation = FrameInterpolation::SNAP,
|
||||||
@@ -52,8 +52,8 @@ namespace TestFrames{
|
|||||||
AnimationFrame linearFillFrame{
|
AnimationFrame linearFillFrame{
|
||||||
.frame = {
|
.frame = {
|
||||||
CreateCell(0,0,0,red),
|
CreateCell(0,0,0,red),
|
||||||
// CreateCell(0.5,0.5,0,green),
|
CreateCell(0.5,0.5,0.5,green),
|
||||||
CreateCell(1,1,0,blue)
|
CreateCell(1,1,1,blue)
|
||||||
},
|
},
|
||||||
.fillInterpolation = FillInterpolation::LINEAR_WEIGHTED_DISTANCE,
|
.fillInterpolation = FillInterpolation::LINEAR_WEIGHTED_DISTANCE,
|
||||||
.frameInterpolation = FrameInterpolation::SNAP,
|
.frameInterpolation = FrameInterpolation::SNAP,
|
||||||
@@ -63,8 +63,8 @@ namespace TestFrames{
|
|||||||
AnimationFrame squareFillFrame{
|
AnimationFrame squareFillFrame{
|
||||||
.frame = {
|
.frame = {
|
||||||
CreateCell(0,0,0,red),
|
CreateCell(0,0,0,red),
|
||||||
// CreateCell(0.5,0.5,0,green),
|
CreateCell(0.5,0.5,0.5,green),
|
||||||
CreateCell(1,1,0,blue)
|
CreateCell(1,1,1,blue)
|
||||||
},
|
},
|
||||||
.fillInterpolation = FillInterpolation::SQUARE_WEIGHTED_DISTANCE,
|
.fillInterpolation = FillInterpolation::SQUARE_WEIGHTED_DISTANCE,
|
||||||
.frameInterpolation = FrameInterpolation::SNAP,
|
.frameInterpolation = FrameInterpolation::SNAP,
|
||||||
@@ -74,8 +74,8 @@ namespace TestFrames{
|
|||||||
AnimationFrame noFillFadeFrame{
|
AnimationFrame noFillFadeFrame{
|
||||||
.frame = {
|
.frame = {
|
||||||
CreateCell(0,0,0,red),
|
CreateCell(0,0,0,red),
|
||||||
// CreateCell(0.5,0.5,0,green),
|
CreateCell(0.5,0.5,0.5,green),
|
||||||
CreateCell(1,1,0,blue)
|
CreateCell(1,1,1,blue)
|
||||||
},
|
},
|
||||||
.fillInterpolation = FillInterpolation::NO_FILL,
|
.fillInterpolation = FillInterpolation::NO_FILL,
|
||||||
.frameInterpolation = FrameInterpolation::FADE,
|
.frameInterpolation = FrameInterpolation::FADE,
|
||||||
@@ -85,8 +85,8 @@ namespace TestFrames{
|
|||||||
AnimationFrame closestColorFadeFrame{
|
AnimationFrame closestColorFadeFrame{
|
||||||
.frame = {
|
.frame = {
|
||||||
CreateCell(0,0,0,red),
|
CreateCell(0,0,0,red),
|
||||||
// CreateCell(0.5,0.5,0,green),
|
CreateCell(0.5,0.5,0.5,green),
|
||||||
CreateCell(1,1,0,blue)
|
CreateCell(1,1,1,blue)
|
||||||
},
|
},
|
||||||
.fillInterpolation = FillInterpolation::CLOSEST_COLOR,
|
.fillInterpolation = FillInterpolation::CLOSEST_COLOR,
|
||||||
.frameInterpolation = FrameInterpolation::FADE,
|
.frameInterpolation = FrameInterpolation::FADE,
|
||||||
@@ -96,8 +96,8 @@ namespace TestFrames{
|
|||||||
AnimationFrame linearFillFadeFrame{
|
AnimationFrame linearFillFadeFrame{
|
||||||
.frame = {
|
.frame = {
|
||||||
CreateCell(0,0,0,red),
|
CreateCell(0,0,0,red),
|
||||||
// CreateCell(0.5,0.5,0,green),
|
CreateCell(0.5,0.5,0.5,green),
|
||||||
CreateCell(1,1,0,blue)
|
CreateCell(1,1,1,blue)
|
||||||
},
|
},
|
||||||
.fillInterpolation = FillInterpolation::LINEAR_WEIGHTED_DISTANCE,
|
.fillInterpolation = FillInterpolation::LINEAR_WEIGHTED_DISTANCE,
|
||||||
.frameInterpolation = FrameInterpolation::FADE,
|
.frameInterpolation = FrameInterpolation::FADE,
|
||||||
@@ -107,8 +107,8 @@ namespace TestFrames{
|
|||||||
AnimationFrame squareFillFadeFrame{
|
AnimationFrame squareFillFadeFrame{
|
||||||
.frame = {
|
.frame = {
|
||||||
CreateCell(0,0,0,red),
|
CreateCell(0,0,0,red),
|
||||||
// CreateCell(0.5,0.5,0,green),
|
CreateCell(0.5,0.5,0.5,green),
|
||||||
CreateCell(1,1,0,blue)
|
CreateCell(1,1,1,blue)
|
||||||
},
|
},
|
||||||
.fillInterpolation = FillInterpolation::SQUARE_WEIGHTED_DISTANCE,
|
.fillInterpolation = FillInterpolation::SQUARE_WEIGHTED_DISTANCE,
|
||||||
.frameInterpolation = FrameInterpolation::FADE,
|
.frameInterpolation = FrameInterpolation::FADE,
|
||||||
@@ -123,7 +123,8 @@ namespace TestFrames{
|
|||||||
noFillFadeFrame, // 4
|
noFillFadeFrame, // 4
|
||||||
closestColorFadeFrame, // 5
|
closestColorFadeFrame, // 5
|
||||||
linearFillFadeFrame, // 6
|
linearFillFadeFrame, // 6
|
||||||
squareFillFadeFrame // 7
|
squareFillFadeFrame, // 7
|
||||||
|
noFillFrame // 8
|
||||||
};
|
};
|
||||||
|
|
||||||
AnimationFrame testFrame1{
|
AnimationFrame testFrame1{
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ void setup() {
|
|||||||
Serial.println("Beginning Board Initializaiton");
|
Serial.println("Beginning Board Initializaiton");
|
||||||
boardManager.Init();
|
boardManager.Init();
|
||||||
animator.SetLoop(true);
|
animator.SetLoop(true);
|
||||||
animator.StartAnimation(&(TestFrames::testAnimationSequence1));
|
animator.StartAnimation(&(TestFrames::testAnimationSequence2));
|
||||||
xTaskCreate(UpdateBoard, "UpdateBoard", 10000, NULL, 0, &updateBoardTask);
|
xTaskCreate(UpdateBoard, "UpdateBoard", 10000, NULL, 0, &updateBoardTask);
|
||||||
|
|
||||||
Serial.println("Setup Complete");
|
Serial.println("Setup Complete");
|
||||||
|
|||||||
Reference in New Issue
Block a user