C3DFile.GetPoints

Previous  Next

 

nFrames = C3DFile.GetPoints( BYVAL nFile       AS INTEGER, 

                             BYREF arrPos      AS REAL,

                            [BYREF arrResid    AS REAL=NULL],

                            [BYREF arrCamMask  AS INTEGER=NULL] ) AS INTEGER

 

ref_arr_ad = C3DFile.GetPoints( BYVAL nFile AS INTEGER ) AS REFERENCE

 


 

Reads the specified Point into the supplied array(s).  The Residual and Camera Mask arrays are optional and the be omitted.  You can use NULL in case you need to use the FileNo parameter.  The function returns the number of frames read if successful.

 

Note that you can pass either arrays or references to arrays.

 

The second syntax allocates a new array using NEW and fills the array with the position data.  The return value is a reference to the new array or NULL if failed.  Only position data can be obtained using this syntax.  Invalids are filled with current C3D invalid value (FLT_MAX).

 

Example:

 

DIM pos( nFrames, nPoints, 3 ) AS REAL

DIM res( nFrames, nPoints ) AS REAL

DIM cam( nFrames, nPoints ) AS INTEGER

 

C3DFile.GetPoints( nFile, pos, res, cam )

 

'' --> Can Omit resids and cam masks

 

C3DFile.GetPoints( nFile, REF( pos ) )

 

' We're using REFs in this example

 

C3DFile.GetPoints( nFile, REF( pos ), REF( res ), REF( cam ) )

 

' Here we're using a dynamic array

 

DIM points AS REFERENCE

 

points = C3DFile.GetPoints( hFile )

 

IF ISREF( points ) THEN

  FOR j = 1 TO nPoints

     PRINT,

     PRINT "3D Positions - Point:";C3DFile.GetPointName( hFile, j ),

 

     FOR i = 1 TO nFrames

        strName = FORMAT( "Frame %04d    : %6.1f, %6.1f, %6.1f, %6.3f, %04d", i, points(i-1,j-1,0), points(i-1,j-1,1), points(i-1,j-1,2) )

        PRINT strName,

     NEXT i

  NEXT j

 

  UNREF points

ENDIF