THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2008 at 11:36, xxxxxxxx wrote:
Watch your value types. The values are Real. For quicker access, you can go like this (for instance) :
> Vector cpos = cam->GetPos();
> GePrint("X: "+RealToString(cpos.x)+", Y: "+RealToString(cpos.y)+", Z: "+RealToString(cpos.z));
You can use LongToString() and the Real will be converted to Long printing integer values nonetheless.
As for the targeted scene camera, I think that you will need to construct this yourself. Just requires two additions to the camera object: a null object and a Target Expression tag added to the camera object. You will need to set the "Target Object" link field on the tag to link the camera to the null object.
You do this by getting the tag's BaseContainer and setting the appropriate ID:
> BaseObject* nobj = BaseObject::Alloc(Onull);
> if (!nobj) return FALSE; // error condition
> doc->InsertObject(nobj, NULL, NULL, FALSE);
> // You may need to use BaseTag::Alloc(Ttargetexpression) and cam->InsertTag(ttag) if MakeTag() doesn't work.
> BaseTag* ttag = cam->MakeTag(Ttargetexpression);
> if (!ttag) return FALSE; // error condition
> ttag->GetDataInstance()->SetLink(TARGETEXPRESSIONTAG_LINK, nobj);