Results 1 to 2 of 2

Thread: Rendering the meshes in ColladaRT.

  1. #1

    Rendering the meshes in ColladaRT.

    Hi there
    I have a document with no animation. Every mesh is inserted inside a node and has its own transformation.So we should draw each mesh with its appropriate transformation. ColladaRT renders the model correctly, But I can't find the transformations inside its rendering functions. Starting from the beginning in colladaRT rendering functions, CrtRender::Render() calls CrtScene::Render(). Then CrtScene::Render() calls CrtNode::Render()
    Code :
    CrtVoid CrtScene::Render()
    {
    if ( SceneRoot )
    {
    SceneRoot->Render(); 
    //CrtPrint("NumTris = %d \n" , gNumTris ); 
    }
    //else
    //CrtPrint(" No Scene Data to render \n" ); 
    }
    CrtNode::Render() calls CrtGeometry:raw() and itselsf
    Code :
    void 	CrtNode::Render()
    {
    //CrtPrint(" Rendering Node %s Type %d \n", Name, (CrtInt32)Type ); 
    if ( _CrtRender.GetShowHiearchy() )
    DrawLineToChildren();
     
    // to concate to the camera which should be already set 	
    _CrtRender.PushMatrix();
    //CrtMatrixLoadIdentity(LocalToWorldMatrix);
    _CrtRender.MultMatrix(LocalToWorldMatrix); 
    _CrtRender.SetCurrentLMMat( LocalToWorldMatrix ); 
     
    for(CrtUInt i=0; i<InstanceGeometries.size(); i++)
    {
    CrtGeometry * geometry = InstanceGeometries[i]->AbstractGeometry;
    geometry->Draw(this);
    //gNumTris += geometry->GetTotalNumTris();
    }
    //Controller here. Skip it
    //CrtPrint(" %s Rendering Children \n", Name ); 
    _CrtRender.PopMatrix(); 
     
    // Render All Children 
    if (Children)
    Children->Render();
    // Render All Siblings 
    if (Next)
    Next->Render(); 
    }
    Then CrtGeometry:raw() calls CrtPolyGroup:raw()
    Code :
    CrtVoid	CrtGeometry::Draw(CrtNode *parentNode)
    {
    //skinning here, Skip it
    for (CrtUInt i = 0; i < Groups.size(); i++ )
    {
    Groups[i]->Draw(parentNode); 
    //TotalNumTris++;
    }
    }
    And finally CrtPolyGroup:raw() calls its rendering function( So CrtTriangles::Render(), CrtTriStrips::Render(), etc. )None of these functions deal with node transformations.The only transformation refers to the camera element inside CrtNode::Render()
    Code :
    // to concate to the camera which should be already set 	
    _CrtRender.PushMatrix();
    //CrtMatrixLoadIdentity(LocalToWorldMatrix);
    _CrtRender.MultMatrix(LocalToWorldMatrix); 
    _CrtRender.SetCurrentLMMat( LocalToWorldMatrix ); 
    ...
    So where to find the transformations of the meshes?
    -Ehsan-

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Foster City, CA
    Posts
    540
    It looks like that last segment you posted is it. I wouldn't trust the comments. If you're looking for where the transforms are read, that's in CrtScene::ReadNodeTranforms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •