Get Point of an Object
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/02/2004 at 04:10, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.100
Platform: Windows ;
Language(s) : C++ ;---------
Hi all
I have one object
BaseObject *ObjGrid = BaseObject::Alloc(Oplane);
I wanna get the point of this particular location for this plane. So i convert it into polygon object:
PolygonObject *ObjToPolygon;
ObjToPolygon = (PolygonObject * ) ToPoly(ObjGrid);
Now i wanna get the point of the particular location. Then I looked into the documentation so that i applied into my code:
for(i=51; 2600; i++) {
Vector *Prevpt;
Prevpt = ObjToPolygon->GetPoint();
if (Prevpt) {
Prevpt[i - 51] ;
}
}
Is what i am doing correct?
Thanks and regards -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/02/2004 at 04:37, xxxxxxxx wrote:
1. Casting the Primitive Object doesn´t help here. It won´t be converted that way. You will need to convert the object with SendModelingCommand for example first and cast the resulting object.
2. GetPoint should performance-wise be gotten before you jump into the loop (and of course you can check if the pointer is valid in front of the loop too). otherwise it´s correct that way.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/02/2004 at 15:31, xxxxxxxx wrote:
Also, please note the typos in the "for(i=51; 2600; i++)". I suppose that was
for(LONG i=51; i < 2600; i++)
before the forum mangled it. Remember to wrap all code in code-tags, as described above the Message field, to avoid this.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/02/2004 at 18:09, xxxxxxxx wrote:
Actually i have a piece of code in COFFEE
for(i=0; i <=XNos; i++) {
** Vector *pt = BaseObject *Obj->GetPoint(i);**
}
And I wanna translate it into C++, so i made like this:
BaseObject *Obj = BaseObject::Alloc(Oplane);
Vector *pt;
for(i=0; i <=XNos; i++) {
** pt = Obj->GetPoint();**
** if (pt) {
pt[i]; **
}
Is that the same way to do it? Thanks for the reply
Regards -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/02/2004 at 17:50, xxxxxxxx wrote:
No, BaseObject has no GetPoint() function. You have to get a "GetType()==Opoly" object first, for example by SendModelingCommand(), and then cast it to a PolygonObject.