Assimp. Location of the mesh?

Started by wartemw, November 11, 2017, 05:46:25

Previous topic - Next topic

wartemw

how to get a position, rotation, scale of the mesh
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;
    }

spasi

See the AINode::mTransformation member. You can traverse the scene nodes using AIScene::mRootNode and then AINode::mChildren/mParent.

wartemw

Quote from: 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.

how to get ainode from aimesh?

wartemw

Quote from: 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.

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