STATE_track_create

 

 



   Creates a new track.
  
   Parameters:
  		points_buffer:
  				contains the x,y,z of the points (example: x1,y1,z1, x2,y2,z2, x3,y3,z3 ....)
  				note that if number_of_points==3 , we need array with 9 doubles (double points[9] )
  				The function will copy the points from the given buffer into an internal storage
  				so that the given points_buffer can be released after calling STATE_track_create() function
  				You can also give NULL. In this case the engine will create a track with zero points.
  				You can then call STATE_track_add_point_to_end() or STATE_track_insert_point() to add points
  				
  		track_name:
  				The name of the track. Note that if track_name is not unique (there is already another track with the same name),
  				the name will be modified so it will be unique. If you use the track name
  				then it is a good practice to check the name after the track was created.
  				or to make sure in advance that the name is unique.
  
   Example A:
  		DWORD my_track=STATE_track_create("My Track1", YES, NULL, 0);   create an empty track
  		double p[3]={100,200,300};
  		STATE_track_add_point_to_end(my_track, p);   add a point to the track

  
   Example B:
  
  		double points[9]={ 0,0,0,   100,0,0, 0,0,100};
  		DWORD trk=STATE_track_create("trk1", YES, points, 3);

  		int num=STATE_track_get_number_of_points(trk);   num should get the value 3
  		double pt[3];
  		for(int i=0; i

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com