Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

Path , shape and image blending

$
0
0

if you draw the arc in the same path as the rect it'll make a hole in it, which is what i think you need. it's not really blending but rather creating a shape with a whole in it with that shape:

//.h
ofPath rect_1;
ofImage img_1;

//setup
rect_1.rectangle(200, 200, 400, 300);
rect_1.moveTo(0,0);
rect_1.arc(0, 0, 50, 50, 30, 120);
rect_1.setFillColor(0, 128, 0);
img_1.loadImage("bg.png");

//draw
img.draw(0,0)
rect1.draw()

if you want to move the arc you can just recreate the path every frame


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>