FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

model disappears when doing sio2ObjectSoftCopy

2 posters

Go down

model disappears when doing sio2ObjectSoftCopy Empty model disappears when doing sio2ObjectSoftCopy

Post  bwalker Mon Aug 03, 2009 1:32 pm

So I integrated tutorial 61's example code for sio2ObjectSoftCopy. I'm copying a cube that resides in the .sio2 file and adjusting its x/y before displaying the copy. Most of the time this works fine, but quite often the original cube randomly disappears (and the new one doesn't appear either). I tried sio2ObjectHardCopy and the same behavior occurred.

Here's the relevant code:
Code:

SIO2object *_original = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource, SIO2_OBJECT, "object/Cube" );

if (_original) {      
   //NSLog ( @"found obj to duplicate %");
   
   static unsigned int i = 0;
   char tmp_name[ SIO2_MAX_CHAR ] = {""};
   sprintf( tmp_name, "%s%d", _original->name, i );
   
   SIO2object *_new = sio2ObjectHardCopy(_original, tmp_name);
   
   _original->_SIO2transform->loc->x = x;
   _original->_SIO2transform->loc->y = y;
   _original->_SIO2transform->loc->z = 0.0f;
   
   sio2TransformCopy( _new->_SIO2transform,
                     _original->_SIO2transform );
      
   sio2TransformBindMatrix( _new->_SIO2transform );

}

bwalker

Posts : 10
Join date : 2009-07-28

Back to top Go down

model disappears when doing sio2ObjectSoftCopy Empty Re: model disappears when doing sio2ObjectSoftCopy

Post  sio2interactive Mon Aug 03, 2009 3:22 pm

Does the pivot point of your model in centered?
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum