ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
FullScreenAnimation.h
Go to the documentation of this file.
1#pragma once
2
3#include "../Animation.h"
4#include "../../Objects/SolidCube.h"
5#include "../../Materials/LightMaterial.h"
6#include "../../Signals/FunctionGenerator.h"
7
8#include "../../Materials/StripeMaterial.h"
9#include "../../Materials/SpiralMaterial.h"
10#include "../../Materials/CombineMaterial.h"
11#include "../../Materials/Animated/SpectrumAnalyzer.h"
12
13//#include "Flash\ImageSequences\Rainbow.h"
14
15class FullScreenAnimation : public Animation<1>{
16private:
17 SolidCube cube;
27
28 //Hex2Sequence gif = Hex2Sequence(Vector2D(500, 500), Vector2D(0, 0), 30);
29 //RainbowSequence gif2 = RainbowSequence(Vector2D(300, 300), Vector2D(0, 0), 30);
30 RGBColor spectrum1[6] = {RGBColor(255, 255, 0), RGBColor(0, 0, 0), RGBColor(0, 255, 255), RGBColor(0, 0, 0), RGBColor(255, 0, 255), RGBColor(0, 0, 0)};
31 RGBColor spectrum2[6] = {RGBColor(255, 0, 0), RGBColor(0, 0, 0), RGBColor(0, 255, 0), RGBColor(0, 0, 0), RGBColor(0, 0, 255), RGBColor(0, 0, 0)};
32 RGBColor spectrum3[6] = {RGBColor(255, 0, 0), RGBColor(255, 255, 0), RGBColor(0, 255, 0), RGBColor(0, 255, 255), RGBColor(0, 0, 255), RGBColor(255, 0, 255)};
33 StripeMaterial stripe1 = StripeMaterial(6, spectrum1, 200.0f, 160.0f, 20.0f);
34 StripeMaterial stripe2 = StripeMaterial(6, spectrum2, 200.0f, 160.0f, 20.0f);
36 //Material* materials[2] = {&stripe1, &spiral};
37
38 //CombineMaterial material = CombineMaterial(CombineMaterial::Subtract, 2, materials);
39
40public:
41 FullScreenAnimation() : Animation<1>() {
42 scene.AddObject(cube.GetObject());
43
44 cube.GetObject()->SetMaterial(&spiral);
45 }
46
47 void Initialize() override {
48
49 }
50
52 return 2;
53 };
54
55 uint8_t GetBrightness(){
56 return 2;
57 };
58
59 void FadeIn(float stepRatio) override {}
60 void FadeOut(float stepRatio) override {}
61
62 void Reset(){
63 //gif.Reset();
64 }
65
66 void Update(float ratio) override {
67 float shift = fGenMatPos.Update();
68 //float size = fGenMatSize.Update();
69 //float rotate = fGenMatRot.Update();
70
71 //sA.Update();
72
73 //gif.SetPosition(Vector2D(0.0f, 135.0f));
74 //gif.SetSize(Vector2D(-size, size));
75 //gif.SetRotation(15.0f + rotate);
76 //gif.Update();
77
78 //gif2.SetPosition(Vector2D(0.0f + shift, 135.0f + shift));
79 //gif2.SetSize(Vector2D(-size, size));
80 //gif2.SetRotation(15.0f + rotate);
81 //gif2.Update();
82
83 //material.SetFirstLayerOpacity(fGenMatOpacity.Update());
84
88 stripe1.SetRotationAngle(ratio * 360.0f);
89 stripe1.SetPositionOffset(Vector2D(shift, shift));
90 /*
91 stripe2.SetStripeWidth(fGenMatWidth.Update());
92 stripe2.SetWavePeriod(fGenMatPeriod.Update());
93 stripe2.SetWaveAmplitude(-fGenMatAmplitude.Update());
94 stripe2.SetRotationAngle((1.0f - ratio) * 360.0f);
95 stripe2.SetPositionOffset(Vector2D(-shift, -shift));
96 */
98 spiral.SetRotationAngle((1.0f - ratio) * 720.0f);
100
101 cube.GetObject()->ResetVertices();
102 cube.GetObject()->GetTransform()->SetScale(Vector3D(1000, 1000, 1));
103 cube.GetObject()->UpdateTransform();
104 }
105};
void Initialize() override
FunctionGenerator fGenMatOpacity
FunctionGenerator fGenMatPeriod
FunctionGenerator fGenMatPos
void FadeIn(float stepRatio) override
void FadeOut(float stepRatio) override
void Update(float ratio) override
FunctionGenerator fGenMatBend
FunctionGenerator fGenMatRot
FunctionGenerator fGenMatWidth
FunctionGenerator fGenMatSize
FunctionGenerator fGenMatAmplitude
FunctionGenerator fGenSelection
A class to generate various waveform functions with customizable parameters.
@ Sine
Sine waveform.
@ Triangle
Triangle waveform.
float Update()
Updates and calculates the next value of the waveform.
Represents an RGB color and provides methods for manipulation.
Definition RGBColor.h:23
Generates a spiral pattern with configurable properties.
void SetPositionOffset(Vector2D positionOffset)
Sets the position offset for the spiral.
void SetRotationAngle(float rotationAngle)
Sets the rotation angle for the spiral.
void SetBend(float bend)
Sets the bending factor of the spiral arms.
Generates striped patterns with configurable properties.
void SetStripeWidth(float stripeWidth)
Sets the stripe width.
void SetPositionOffset(Vector2D positionOffset)
Sets the position offset for the pattern.
void SetRotationAngle(float rotationAngle)
Sets the rotation angle for the pattern.
void SetWaveAmplitude(float waveAmplitude)
Sets the wave amplitude for the sinusoidal effect.
void SetWavePeriod(float wavePeriod)
Sets the wave period for the sinusoidal effect.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Definition Vector2D.h:27
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
Definition Vector3D.h:26