ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
RainbowSpiral.cpp
Go to the documentation of this file.
1#include "RainbowSpiral.h"
2
3void RainbowSpiral::Update(float ratio) {
4 spiralMaterial.SetBend(fGenMatBend.Update());
5 spiralMaterial.SetRotationAngle((1.0f - ratio) * 360.0f);
6 spiralMaterial.SetPositionOffset(Vector2D(0.0f, 75.0f));
7}
8
12
13RGBColor RainbowSpiral::GetRGB(const Vector3D& position, const Vector3D& normal, const Vector3D& uvw) {
14 return spiralMaterial.GetRGB(position, normal, uvw);
15}
A dynamic material that creates a colorful, animated rainbow spiral effect.
Abstract base class for rendering materials.
Definition Material.h:27
Represents an RGB color and provides methods for manipulation.
Definition RGBColor.h:23
Material * GetMaterial()
Retrieves the associated spiral material.
RGBColor GetRGB(const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
Computes the color at a given position in the material.
SpiralMaterial spiralMaterial
Spiral material configured with rainbow spectrum and scale parameters.
FunctionGenerator fGenMatBend
Function generator for animating spiral bending.
void Update(float ratio)
Updates the material animation based on the time ratio.
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