Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have just readed this tutorial about load a 3D model file: http://www.lighthouse3d.com/cg-topics/code-samples/importing-3d-models-with-assimp/. Its render routine uses a recursive_render function to scan all node.

My question:

  1. What is a aiNode struct store?
  2. What different form this method and above method:

    for (int i=0; imNumMesh; ++i) { draw scene->mMeshes[i]; }

Thanks for reading!

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

1) The aiNode struct is defined in the Assimp library. Here you can find it its definition on the official documentation:

Public Attributes
aiNode **       mChildren       // The child nodes of this node.
unsigned int *  mMeshes         // The meshes of this node.
aiString        mName           // The name of the node.
unsigned int    mNumChildren    // The number of child nodes of this node.
unsigned int    mNumMeshes      // The number of meshes of this node.
aiNode *        mParent         // Parent node.
aiMatrix4x4     mTransformation // The transformation relative to the node's parent. 

2) I don't know what is the difference between "your method" and recursive_render, but looks like you are missing a lot of information (childs, etc). I'd have a closer look to recursive_render

share|improve this answer
    
thanks for reply, that is what i do not understands, why they are divided model into more "nodes" but not only meshes? –  Bình Nguyên Jun 20 '12 at 15:29
    
For a definition of "node", I recommend that you read the section about "The Node Hierarchy" from assimp.sourceforge.net/lib_html/data.html. "A node can potentially refer to single or multiple meshes. The meshes are not stored inside the node, but instead in an array of aiMesh inside the aiScene. A node only refers to them by their array index. This also means that multiple nodes can refer to the same mesh, which provides a simple form of instancing." –  Dan Jun 20 '12 at 15:45
    
thanks for your reply :) –  Bình Nguyên Jun 20 '12 at 15:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.