ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
GammaControllerFront.h
Go to the documentation of this file.
1#include <Arduino.h>
2#include <OctoWS2811.h>
3
4#include "Controller.h"
5#include "Render/Camera.h"
6#include "Flash/PixelGroups/KaiborgV1Pixels.h"
7
8const int ledsPerStrip = 346;
9DMAMEM int displayMemory[346 * 6];
10int drawingMemory[346 * 6];
11const int config = WS2811_GRB | WS2811_800kHz;
12
14
16private:
18
19 Transform camTopTransform = Transform(Vector3D(0.0f, 0.0f, -139.06f), Vector3D(46.445f, 130.121f, -500.0f), Vector3D(1, 1, 1));
20 Transform camBotTransform = Transform(Vector3D(0.0f, 180.0f, 0.0f), Vector3D(0, 0, -500.0f), Vector3D(1, 1, 1));
21
24
27
29
30public:
32
33 void Initialize() override{
34 leds.begin();
35 leds.show();
36 }
37
38 void Display() override {
39 int offset;
40
41 for (int i = 0; i < 571; i++){
44 }
45
46 //0: BLT, RIGHT
47 //1: FLT, RIGHT
48 //2: BRT, LEFT
49 //3: FRT, LEFT
50 //4: BRB, RIGHT
51 //5: FRB, RIGHT
52 //6: BLB, LEFT
53 //7: FLB, LEFT
54
55 for (int i = 0; i < 571; i++) {
56 if (i < 346){
57 offset = i + 225;
58 leds.setPixel(i + 346 * 0, camTopPixels.GetColor(i)->R, camTopPixels.GetColor(i)->G, camTopPixels.GetColor(i)->B);//Top Right
59 leds.setPixel(570 - i + 346 * 4, camBotPixels.GetColor(i)->R, camBotPixels.GetColor(i)->G, camBotPixels.GetColor(i)->B);//Bottom Right
60
61 leds.setPixel(i + 346 * 2, camTopPixels.GetColor(570 - offset)->R, camTopPixels.GetColor(570 - offset)->G, camTopPixels.GetColor(570 - offset)->B);//Top Left
62 leds.setPixel(i + 346 * 6, camBotPixels.GetColor(offset)->R, camBotPixels.GetColor(offset)->G, camBotPixels.GetColor(offset)->B);//Bottom Left
63 }
64 else{
65 offset = i - 346;
66 leds.setPixel(i + 346 * 1 - 346, camTopPixels.GetColor(i)->R, camTopPixels.GetColor(i)->G, camTopPixels.GetColor(i)->B);//Top Right
67 leds.setPixel(570 - i + 346 * 5 - 346, camBotPixels.GetColor(i)->R, camBotPixels.GetColor(i)->G, camBotPixels.GetColor(i)->B);//Bottom Right
68
69 leds.setPixel(i + 346 * 3 - 346, camTopPixels.GetColor(570 - offset)->R, camTopPixels.GetColor(570 - offset)->G, camTopPixels.GetColor(570 - offset)->B);//Top Left
70 leds.setPixel(i + 346 * 7 - 346, camBotPixels.GetColor(offset)->R, camBotPixels.GetColor(offset)->G, camBotPixels.GetColor(offset)->B);//Bottom Left
71 }
72 }
73
74 leds.show();
75 }
76
77 void SetPixels(uint8_t strip, uint16_t led, RGBColor rgb){
78 leds.setPixel(346 * strip + led, rgb.R, rgb.G, rgb.B);//Pin 8
79 }
80};
Declares the Controller base class for managing lighting controllers.
DMAMEM int displayMemory[346 *6]
const int config
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config)
int drawingMemory[346 *6]
const int ledsPerStrip
Base class for managing camera properties and transformations.
Definition CameraBase.h:26
Manages camera orientation and axis alignment.
@ YUp
Up along the positive Y-axis.
@ ZForward
Forward along the positive Z-axis.
Manages camera behavior and pixel groups.
Definition Camera.h:27
Base class for managing brightness and display operations of lighting controllers.
Definition Controller.h:25
uint8_t brightness
Current brightness level.
Definition Controller.h:32
uint8_t maxBrightness
Maximum allowed brightness level.
Definition Controller.h:34
PixelGroup< 571 > camBotPixels
void Initialize() override
Initializes the controller.
void SetPixels(uint8_t strip, uint16_t led, RGBColor rgb)
void Display() override
Updates and displays content on the lighting system.
GammaControllerFront(uint8_t maxBrightness)
PixelGroup< 571 > camTopPixels
@ ZEROTOMAX
Traverse from minimum to maximum indices.
Definition IPixelGroup.h:32
@ MAXTOZERO
Traverse from maximum to minimum indices.
Definition IPixelGroup.h:33
Manages a collection of pixels with positions, colors, and spatial relationships.
Definition PixelGroup.h:27
RGBColor * GetColor(uint16_t count) override
Retrieves the color of a specific pixel.
Represents an RGB color and provides methods for manipulation.
Definition RGBColor.h:23
RGBColor Scale(const uint8_t &maxBrightness)
Scales the brightness of the color to a maximum value.
Definition RGBColor.cpp:29
uint8_t B
Blue component of the color (0-255).
Definition RGBColor.h:27
uint8_t G
Green component of the color (0-255).
Definition RGBColor.h:26
uint8_t R
Red component of the color (0-255).
Definition RGBColor.h:25
Represents a 3D transformation including position, rotation, and scale.
Definition Transform.h:22
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Definition Vector3D.h:26