Adding support for pattern.
Still a bit more work to be done there.
This commit is contained in:
36
source/include/pattern.h
Normal file
36
source/include/pattern.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* DoRayMe - a quick and dirty Raytracer
|
||||
* Pattern header
|
||||
*
|
||||
* Created by Manoël Trapier
|
||||
* Copyright (c) 2020 986-Studio.
|
||||
*
|
||||
*/
|
||||
#ifndef DORAYME_PATTERN_H
|
||||
#define DORAYME_PATTERN_H
|
||||
|
||||
#include <colour.h>
|
||||
#include <tuple.h>
|
||||
#include <matrix.h>
|
||||
|
||||
class Shape;
|
||||
|
||||
class Pattern
|
||||
{
|
||||
public:
|
||||
Colour a;
|
||||
Colour b;
|
||||
|
||||
Matrix transformMatrix;
|
||||
Matrix inverseTransform;
|
||||
|
||||
public:
|
||||
Pattern(Colour a, Colour b);
|
||||
|
||||
virtual Colour patternAt(Tuple point) = 0;
|
||||
|
||||
void setTransform(Matrix transform);
|
||||
Colour patternAtObject(Shape *object, Tuple point);
|
||||
};
|
||||
|
||||
#endif /* DORAYME_PATTERN_H */
|
||||
Reference in New Issue
Block a user