Hello Guest

Assimp. Location of the mesh?

  • 3 Replies
  • 888 Views
Assimp. Location of the mesh?
« on: November 11, 2017, 05:46:25 »
how to get a position, rotation, scale of the mesh
Code: [Select]
private Mesh loadMesh(AIMesh aiMesh, AIScene aiScene) {
        Vao vao = Vao.create();
        Transforming transforming = loadTransforming(aiMesh);
        int[] indices = loadIndices(aiMesh);
        float[] vertices = loadVertices(aiMesh);
        float[] textCoord = loadTextCoord(aiMesh);
}


private Transforming loadTransforming(AIMesh aiMesh) {
        Transforming transforming = new Transforming();

        transforming.setPosition(           ?           );
        transforming.setRotation(           ?           );
        transforming.setScale(          ?           );

        return transforming;
    }

*

Offline spasi

  • *****
  • 2042
    • WebHotelier
Re: Assimp. Location of the mesh?
« Reply #1 on: November 11, 2017, 10:45:32 »
See the AINode::mTransformation member. You can traverse the scene nodes using AIScene::mRootNode and then AINode::mChildren/mParent.

Re: Assimp. Location of the mesh?
« Reply #2 on: November 11, 2017, 13:33:51 »
See the AINode::mTransformation member. You can traverse the scene nodes using AIScene::mRootNode and then AINode::mChildren/mParent.

how to get ainode from aimesh?

Re: Assimp. Location of the mesh?
« Reply #3 on: November 11, 2017, 14:21:28 »
See the AINode::mTransformation member. You can traverse the scene nodes using AIScene::mRootNode and then AINode::mChildren/mParent.

Thank you! I check by name. everything is working.