Files
dorayme/source/pattern/strippattern.h
2020-02-21 12:05:30 +00:00

33 lines
557 B
C++

/*
* DoRayMe - a quick and dirty Raytracer
* Strip Pattern header
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#ifndef DORAYME_STRIPPATTERN_H
#define DORAYME_STRIPPATTERN_H
#include <pattern.h>
#include <stdio.h>
class StripPattern : public Pattern
{
public:
StripPattern(Colour a, Colour b) : Pattern(a, b) { };
Colour patternAt(Tuple point)
{
if (fmod(floor(point.x), 2) == 0)
{
return this->a;
}
return this->b;
}
};
#endif /* DORAYME_STRIPPATTERN_H */