ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
HorizontalRainbow.cpp
Go to the documentation of this file.
1#include "HorizontalRainbow.h"
2
3void HorizontalRainbow::Update(float ratio) {
4 positionOffset -= 1.0f;
5
6 gNoiseMat.SetRotationAngle(90.0f);
7 gNoiseMat.SetPositionOffset(Vector2D(positionOffset, 0.0f));
8 gNoiseMat.SetGradientPeriod(96.0f);
9}
10
14
15RGBColor HorizontalRainbow::GetRGB(const Vector3D& position, const Vector3D& normal, const Vector3D& uvw) {
16 return gNoiseMat.GetRGB(position, normal, uvw);
17}
A dynamic horizontal rainbow gradient material.
GradientMaterial< 6 > gNoiseMat
Gradient material for the rainbow spectrum.
Material * GetMaterial()
Retrieves the associated material.
RGBColor GetRGB(const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
Computes the color at a given position in the gradient.
void Update(float ratio)
Updates the gradient animation based on the provided time ratio.
float positionOffset
Position offset for animating the gradient.
Abstract base class for rendering materials.
Definition Material.h:27
Represents an RGB color and provides methods for manipulation.
Definition RGBColor.h:23
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