openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.95k stars 2.55k forks source link

ofPlanePrimitive initialization out by 1 #2627

Open pierrep opened 11 years ago

pierrep commented 11 years ago

When an ofPlanePrimitive (ofMesh::plane) is created, it is initialised with values for 'rows' and 'columns' to describe the plane. At the moment this seems to be out by 1, so that you end up creating a plane with rows-1 and columns-1 rows and columns respectively.

To test this, just try creating a plane with 1 row and 1 column, e.g. ofPlanePrimitive p = ofPlanePrimitive( 300, 300, 1, 1, OF_PRIMITIVE_TRIANGLE_STRIP ); p.drawWireframe();

You'll find that nothing is drawn. Bug present in latest github code.

kylemcdonald commented 11 years ago

The behavior of these values is also counterintuitive to me, I would call it a big unless someone has a good argument for it :)

On Wednesday, October 23, 2013, Pierre Proske wrote:

When an ofPlanePrimitive (ofMesh::plane) is created, it is initialised with values for 'rows' and 'columns' to describe the plane. At the moment this seems to be out by 1, so that you end up creating a plane with rows-1 and columns-1 rows and columns respectively.

To test this, just try creating a plane with 1 row and 1 column, e.g. ofPlanePrimitive p = ofPlanePrimitive( 300, 300, 2, 2, OF_PRIMITIVE_TRIANGLE_STRIP ); p.drawWireframe();

You'll find that nothing is drawn. Bug present in latest github code.

— Reply to this email directly or view it on GitHubhttps://github.com/openframeworks/openFrameworks/issues/2627 .