The Object vector CSV functions in this snippet provides you with what you need to quickly output text or assign values containing the position, rotation, scale or size of objects or limbs.
Rather than writing the following frequently used operation:
Text 0, 0, Str$( Object Angle X(id), 1) + "," + Str$( Object Angle Y(id), 1) + "," + Str$( Object Angle Z(id), 1)
You can perform the same with less code by writing the following:
Text 0, 0, ObjAng$( objectId, iDecimalPoints )
Each function has an additional version which returns the comma seperated string with spaces. All functions require a decimal point count.
I provided a Vector2, Vector3 and Vector4 version of this solution
here, which requires Matrix1 utilities to validate vector types.
//=====================================================
Function ObjSize$( id, iActualSize, iDecimalPoints )
r$=Str$( Object Size X(id,iActualSize), iDecimalPoints ) + "," + Str$( Object Size Y(id,iActualSize), iDecimalPoints ) + "," + Str$( Object Size Z(id,iActualSize), iDecimalPoints )
EndFunction r$
//=====================================================
Function ObjSize_$( id, iActualSize )
r$=Str$( Object Size X(id,iActualSize) ) + ", " + Str$( Object Size Y(id,iActualSize) ) + ", " + Str$( Object Size Z(id,iActualSize) )
EndFunction r$
//=====================================================
Function ObjScale$( id, iDecimalPoints )
r$=Str$( Object Scale X(id), iDecimalPoints ) + ", " + Str$( Object Scale Y(id), iDecimalPoints ) + ", " + Str$( Object Scale Z(id), iDecimalPoints )
EndFunction r$
//=====================================================
Function ObjScale_$( id )
r$=Str$( Object Scale X(id) ) + "," + Str$( Object Scale Y(id) ) + "," + Str$( Object Scale Z(id) )
EndFunction r$
//=====================================================
Function ObjPos$( id, iDecimalPoints )
r$=Str$( Object Position X(id), iDecimalPoints ) + "," + Str$( Object Position Y(id), iDecimalPoints ) + "," + Str$( Object Position Z(id), iDecimalPoints )
EndFunction r$
//=====================================================
Function ObjPos_$( id )
r$=Str$( Object Position X(id) ) + ", " + Str$( Object Position Y(id) ) + ", " + Str$( Object Position Z(id) )
EndFunction r$
//=====================================================
Function ObjAng$( id, iDecimalPoints )
r$=Str$( Object Angle X(id), iDecimalPoints ) + "," + Str$( Object Angle Y(id), iDecimalPoints ) + "," + Str$( Object Angle Z(id), iDecimalPoints )
EndFunction r$
//=====================================================
Function ObjAng_$( id )
r$=Str$( Object Angle X(id) ) + ", " + Str$( Object Angle Y(id) ) + ", " + Str$( Object Angle Z(id) )
EndFunction r$
//=====================================================
Function CamPos$( id, iDecimalPoints )
r$=Str$( Camera Position X(id), iDecimalPoints ) + "," + Str$( Camera Position Y(id), iDecimalPoints ) + "," + Str$( Camera Position Z(id), iDecimalPoints )
EndFunction r$
//=====================================================
Function CamPos_$( id )
r$=Str$( Camera Position X(id) ) + ", " + Str$( Camera Position Y(id) ) + ", " + Str$( Camera Position Z(id) )
EndFunction r$
//=====================================================
Function CamAng$( id, iDecimalPoints )
r$=Str$( Camera Angle X(id), iDecimalPoints ) + "," + Str$( Camera Angle Y(id), iDecimalPoints ) + "," + Str$( Camera Angle Z(id), iDecimalPoints )
EndFunction r$
//=====================================================
Function CamAng_$( id )
r$=Str$( Camera Angle X(id) ) + ", " + Str$( Camera Angle Y(id) ) + ", " + Str$( Camera Angle Z(id) )
EndFunction r$
//=====================================================
Function LimbAng$( iObjectId, iLimbId, iDecimalPoints )
r$=Str$( Limb Angle X( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Angle Y( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Angle Z( iObjectId, iLimbId), iDecimalPoints )
EndFunction r$
//=====================================================
Function LimbAng_$( iObjectId, iLimbId, iDecimalPoints )
r$=Str$( Limb Angle X( iObjectId, iLimbId), iDecimalPoints ) + ", " + Str$( Limb Angle Y( iObjectId, iLimbId), iDecimalPoints ) + ", " + Str$( Limb Angle Z( iObjectId, iLimbId), iDecimalPoints )
EndFunction r$
//=====================================================
Function LimbDir$( iObjectId, iLimbId, iDecimalPoints )
r$=Str$( Limb Direction X( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Direction Y( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Direction Z( iObjectId, iLimbId), iDecimalPoints )
EndFunction r$
//=====================================================
Function LimbDir_$( iObjectId, iLimbId )
r$=Str$( Limb Direction X( iObjectId, iLimbId) ) + ", " + Str$( Limb Direction Y( iObjectId, iLimbId) ) + ", " + Str$( Limb Direction Z( iObjectId, iLimbId) )
EndFunction r$
//=====================================================
Function LimbOffset$( iObjectId, iLimbId, iDecimalPoints )
r$=Str$( Limb Offset X( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Offset Y( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Offset Z( iObjectId, iLimbId), iDecimalPoints )
EndFunction r$
//=====================================================
Function LimbOffset_$( iObjectId, iLimbId )
r$=Str$( Limb Offset X( iObjectId, iLimbId) ) + ", " + Str$( Limb Offset Y( iObjectId, iLimbId) ) + ", " + Str$( Limb Offset Z( iObjectId, iLimbId) )
EndFunction r$
//=====================================================
Function LimbPos$( iObjectId, iLimbId, iDecimalPoints )
r$=Str$( Limb Position X( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Position Y( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Position Z( iObjectId, iLimbId), iDecimalPoints )
EndFunction r$
//=====================================================
Function LimbPos_$( iObjectId, iLimbId )
r$=Str$( Limb Position X( iObjectId, iLimbId) ) + ", " + Str$( Limb Position Y( iObjectId, iLimbId) ) + ", " + Str$( Limb Position Z( iObjectId, iLimbId) )
EndFunction r$
//=====================================================
Function LimbScale$( iObjectId, iLimbId, iDecimalPoints )
r$=Str$( Limb Scale X( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Scale Y( iObjectId, iLimbId), iDecimalPoints ) + "," + Str$( Limb Scale Z( iObjectId, iLimbId), iDecimalPoints )
EndFunction r$
//=====================================================
Function LimbScale_$( iObjectId, iLimbId )
r$=Str$( Limb Scale X( iObjectId, iLimbId) ) + ", " + Str$( Limb Scale Y( iObjectId, iLimbId) ) + ", " + Str$( Limb Scale Z( iObjectId, iLimbId) )
EndFunction r$
//=====================================================