Closed AnasGhrab closed 5 years ago
here is a very simple example to make a triangle.
// in .h
// shared_ptr<ofxBox2dPolygon> poly;
// on click
poly = make_shared<ofxBox2dPolygon>();
poly->setPhysics(1, 0.5, 0.5);
// make a triangle
poly->addVertex(-100, 100);
poly->addVertex(0, -100);
poly->addVertex(100, 100);
// now create the b2d shape
poly->create(box2d.getWorld());
// now move to center of screen
poly->setPosition(ofGetWidth()/2, ofGetHeight()/2);
Hi,
Is it possible to add an example for a simple Polygon so to better understand how to construct objects other than circle and rects ? Maybe using an ofPath ?
Many thanks.
-- Anas