THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/06/2008 at 07:31, xxxxxxxx wrote:
Cinema 4D Version: 10.5
Language(s) : C++ ;
Since I am operating on a polygon object, I can simply add vertices by adding it word-space position at index v.
\> Vector *padr;
\> padr[v] = Vector(pos_x,pos_y,pos_z);
But how is a vertex delete from the Vector ? Setting its position to triple zero does not delete this entry from the structure.
While beeing in the object manager's stucture tab, I can delete a vertex easily.
How to do this by c++ code ?!
Cheers and have a nice weekend
On 22/06/2008 at 07:18, xxxxxxxx wrote:
Sunny Sunday folks,
after diggin' nearly 6 hours in the examples, this forum and the doc, I managed to figure out how to delete a specific vertex.
\> AutoAlloc<Modeling> engine;
\> if(!engine->InitObject(op)) return FALSE;
Now comes the but: It seems the modeling engine requires a LOT of C4D-resources. Does anyone know another (less ressource expensive) solution ?
On 22/06/2008 at 08:54, xxxxxxxx wrote:
I'd take a look at VariableChanged in the SDK documentation.
One thing to consider is that if you remove a point from a polygonal object, you'll have to do something about the 'gap' in the vertex array (shift the vectors with higher index to the left one) as well as the change the vertex indexing for the polygons in the polygonal array. You'll also need to consider what to do with polygons that may no longer be closed or leave holes as a result of removing the point.
Basically, adding (appending) points is simple while removing them can get complex.
On 22/06/2008 at 09:09, xxxxxxxx wrote:
As an alternative to VariableChanged for deletion of points or polygons you make want to look into SendModelingCommmand() with MCOMMAND_DELETE and ModelingCommandData using MODIFY_POINTSELECTION or MODIFY_POLYGONSELECTION.
The points or polygons to be deleted must be selected on the object. I'm not exactly sure offhand how to select them programmatically. I tend to be using selection tags for this type of thing.
On 22/06/2008 at 10:40, xxxxxxxx wrote:
I use a bundle of traversion algorithms setting up a triangle strip. To that triangle strip vertex points are appended with CPolygon(prelast,last,v). So i just have to deal with the gap in the vertex array. The longer I think about the Modeling, the more I believe in Allocating and Feeing it manually when it is needed -> around the modelingprocess. After removing a point there is no need for the Modeling anymore. Hmm I have to test a few things with that type...