Center of object from

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
SIO2object *tmp = sio2ResourceGetObject( sio2->_SIO2resource, "name of your object" );

         tmp->buf = ( unsigned char * )sio2MapBuffer( tmp->vbo, GL_ARRAY_BUFFER );

         unsigned int i = 0,
                n_vert = sio2ObjectGetNumVert( tmp );
           
         while( i != n_vert )
         {
            vec3 v;

            memcpy( &v, &tmp->buf[ i * 12 ], 12 );
           
            printf("%f %f %f\n", v.x, v.y, v.z);
         
            ++i;
         }

         tmp->buf = ( unsigned char * )sio2UnmapBuffer( GL_ARRAY_BUFFER );

 

duplicate object my version

1
2
3
4
5
SIO2object *object = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                             SIO2_OBJECT,
                                              "name object for duplicate" );
     
SIO2object  *new = sio2ObjectDuplicate(object, object->_SIO2transform, " name by new object", 1);

 

handle parent to child my version

1
2
3
4
5
6
7
8
SIO2object *parent = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                             SIO2_OBJECT,
                                              "name parent" );
SIO2object *child = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                             SIO2_OBJECT,
                                              "name child" );

child->_SIO2transform->_SIO2parent = parent->_SIO2transform;