THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/02/2003 at 21:28, xxxxxxxx wrote:
Cinema 4D Version: 8.012
Language(s) : C.O.F.F.E.E ;
Having some confusion between the BaseObject in the SDK c4d_baseobject.h listing..
In the plain BaseObject listing there aren't methods like Triangulate as in c4d_baseobject.h file.
does any BaseObject have access too the Triangulate method?
do I create a c4d_baseobject from a regular BaseObject in order to get access to those methods?
..what i'm trying to do is do an auto-triangulate on polys from quads or primitives (& nurbs?) in the exporter i'm writing..
On 12/02/2003 at 00:14, xxxxxxxx wrote:
If you wish to get a PolygonObject from any non-polygon object (such as a Primitive or HyperNURBS), then you need to use the SendModelingCommand() with the MCOMMAND_CURRENTSTATETOOBJECT. Once you have a PolygonObject you can also use the MCOMMAND_TRIANGULATE if you wish, but triangulating the polygons is easier/quicker to do it as you export each quad, you can check if the polygon is already a tri by checking if vadr[i].c==vadr[i].d (where, i is the polygon ID and vadr is Polygon *vadr). If it is a quad, just return the tri's as a -> b -> c and a -> c -> d.
On 12/02/2003 at 07:43, xxxxxxxx wrote:
i'll give that a shot. I'll try your method that you posted.
wondering if you could shed some light on this issue, i'm gonna try your way, but was running into an issue that i couldn;t figure out before:
I am trying to use Triangulate from c4d_baseobject, and i'm getting link errors during compile.. if I put wrong arguements into Triangulate() codewarrior comes up with the "Does not match" error.. but once I get all the right arguements in it, i get a link error like it can't find the right function... etc.
(I have compiled the c4d .lib and included the c4d.h in the project)
LONG polyCount = ToPoly( inNode )->GetPolygonCount();
LONG pointCount = ToPoly( inNode )->GetPointCount();
Vector* vectorPointArray = ToPoly( inNode )->GetPoint();
Polygon* polyMeshArray = ToPoly( inNode )->GetPolygon();
Triangulate( vectorPointArray, pointCount, &polyMeshArray;, &polyCount; );
On 12/02/2003 at 07:52, xxxxxxxx wrote:
Also, I saw in the STL example:
doc->Polygonize()l was used..
do you recommend this instead of going on a per-object basis or is it slower or does it do a poor job making polygons from certain surfaces?
On 12/02/2003 at 09:04, xxxxxxxx wrote:
Polygonize() is an easy way to get the whole document as polygon objects, if that is all you care about then it is an easy way to go, I've used it before for exporting, can can actually look at its code, c4d_basedocument.cpp. I now prefer doing it per object myself since the code can make decissions about objects, depends on your exporter if it only wants polygons or not.
As for Triangulate(), which SDK are you using? in R8 there is no Triangulate function, and besides, that was for turning splines to polygons! to turn quads into tris you need to use the SendModelingCommand(), but it really is faster/better to do it per polygons yourself during export if needed, it is a quick choice of checking of the polygon is a quad or tri, then exporting two tris when a quad, but that too also depends how complex your exporter needs to be and what other information it is exporting, such as material restrictions to polygons.
On 12/02/2003 at 10:21, xxxxxxxx wrote:
Thanks for clearing up the Triangulate.. It is still listed in the documentation in the c4d_baseobject.h and not in BaseObject so I was confused..
Now that you showed me the MCOMMAND_CURRENTSTATETOOBJECT, i'm going to do it that way.
and I think I might have use the SendModelingCommand() to triangulate the object to make it easier to gather the UVW and normal information for export...my little mind might not be able to handle the stress!