LWJGL Forum

Please login or register.

Login with username, password and session length

Author Topic: Assimp. Location of the mesh?  (Read 102 times)

wartemw

  • Newbie
  • *
  • Offline Offline
  • Posts: 27
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;
    }
Logged

spasi

  • Administrator
  • Nerdus Imperius
  • *****
  • Online Online
  • Posts: 1892
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.
Logged

wartemw

  • Newbie
  • *
  • Offline Offline
  • Posts: 27
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?
Logged

wartemw

  • Newbie
  • *
  • Offline Offline
  • Posts: 27
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.
Logged