Instancing Help

View previous topic View next topic Go down

Instancing Help

Post  jj on Sun Oct 05, 2008 9:59 pm

Could you go over the basics of instancing and parenting? I have 6 objects (Cube, Cylinder.001, Cylinder.002, Cylinder.003, Cylinder.004, Cylinder.005) and only one instance (Cylinder) is rendering.

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Instancing Help

Post  sio2interactive on Sun Oct 05, 2008 10:35 pm

Ok...

1. From Blender create a Cube

2. Then ALT+D in object mode

3. Now Cube = Parent and Cube.001 = Child (Cube.001 share all generic object properties from Cube, expect like pos, rot, scl and all other object specific properties)

4. In SIO2 after you load the scene:

Code:

   sio2ResourceBindAllImages( sio2->_SIO2resource );
   
   sio2ResourceBindAllMaterials( sio2->_SIO2resource );

   // This is the line that will bind all child to the Cube. In addition when you
   // export make sure that Cube is in the same layer as Cube.001, that's
   // all there is to it... all the rest Im handling in the background...
   sio2ResourceBindAllInstances( sio2->_SIO2resource );

   sio2ResourceBindAllPhysicObjects( sio2->_SIO2resource,
                             sio2->_SIO2physic );

   sio2ResourceGenId( sio2->_SIO2resource );

That's it... maybe review the tutorial06 (video + code) to grasp exactly how to do it...
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: Instancing Help

Post  jj on Sun Oct 05, 2008 11:17 pm

Thanks, I will check it out. Another problem I'm having (seems simple) is that I'm getting a program interrupt on a static triangle mesh as a ghost (for collision): Here are the methods called in the trace:

Code:
 
void sio2ResourceBindAllPhysicObjects( SIO2resource *_SIO2resource,
                             SIO2physic  *_SIO2physic )
{
   unsigned int i = 0;
   
   while( i != _SIO2resource->n_object )
   {
      sio2PhysicAddObject( _SIO2physic,
                      ( SIO2object * )_SIO2resource->_SIO2object[ i ] );
      ++i;
   }
}

Code:

   _btCollisionShape = new btBvhTriangleMeshShape( _btTriangleMesh, 1 );

Code:

if (buildBvh)
   {
      void* mem = btAlignedAlloc(sizeof(btOptimizedBvh),16);
      m_bvh = new (mem) btOptimizedBvh();
      m_bvh->build(meshInterface,m_useQuantizedAabbCompression,bvhAabbMin,bvhAabbMax);
      m_ownsBvh = true;
   }

Code:

buildTree(0,numLeafNodes);

Code:

//btOptimizedBvh::buildTree
assert(numIndices>0);

Leads to _kill. Something I'm missing?

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Instancing Help

Post  sio2interactive on Sun Oct 05, 2008 11:53 pm

I don't know man... too hard to tell maybe send me the model (.blend) that cause problem so I can check it out...
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: Instancing Help

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


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