← Back

ofxKaleidoscope

github.com/skell999/ofxKaleidoscope · @skell999
OF 0.11 Graphics Shaders

Gpu based kaleidoscope openframworks addon.

0 0 Last commit 6y ago Created 6y ago

README

ofxKaleidoscope

Gpu based kaleidoscope. Openframeworks addon.

<img src="https://github.com/skell999/ofxKaleidoscope/blob/main/gif/kal.gif" width="512" height="384" />

Basic usage



ofApp members

ofxKaleidoscope kal;
ofImage image;


Setup

ofDisableArbTex();
kal.allocate(ofGetWidth(), ofGetHeight());
image.load("yourImageFile.jpg");
image.getTexture().setTextureWrap(GL_REPEAT, GL_REPEAT);


Update

float div = 8;
float rotate = 0;
auto translate = glm::vec2(0.0, 0.0);

float spin = 0.0;
float zoom = 1.0;

bool enableRepitition = false;
float repetitions = 4.0;

auto stretch = glm::vec2(1.0, 1.0);

bool enablePowDistortX = false;
bool enablePowDistortY = false;
auto powDistort = glm::vec2(1.0, 1.0);

bool flipImage = false;

rotate = ofGetElapsedTimef() * 0.08;

kal.update(
	pic[currentImage].getTexture(), 
	div, 
	rotate, 
	translate, 
	spin, 
	zoom, 
	enableRepitition, 
	repetitions, 
	stretch, 
	enablePowDistortX, 
	enablePowDistortY, 
	powDistort, 
	flipImage
);


Draw

kal.draw(0,0);

Get this addon

HTTPS
SSH