LWJGL Forum

Programming => OpenGL => Topic started by: wartemw on November 11, 2017, 05:46:25

Title: Assimp. Location of the mesh?
Post by: wartemw 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;
    }
Title: Re: Assimp. Location of the mesh?
Post by: spasi 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.
Title: Re: Assimp. Location of the mesh?
Post by: wartemw 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?
Title: Re: Assimp. Location of the mesh?
Post by: wartemw 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.