I load my 3D model (.x) and textures (.DDS) and yes dds is enabled. I also apply a rotation to the model. The model loads but the rotation has not taken effect. Once I move the camera the model immediately switches and has the rotation applied. I have debugged and verified the rotation code is applied properly and only ones just after the model is loaded.
Code: Select all
irr::core::stringc modelPath = path + "\\models\\" + selectedRace + "\\" + selectedShip + "\\" + textureData[0];
irr::scene::IMesh * playerModel = smgr->getMesh(modelPath);
node = smgr->addMeshSceneNode(playerModel);
if (node != nullptr) {
node->setMaterialFlag(irr::video::EMF_LIGHTING, false);
for (int i = 0; i < numTextures; i++) {
modelPath = path + "\\models\\" + selectedRace + "\\" + selectedShip + "\\" + textureData[i + 1];
node->setMaterialTexture(i, driver->getTexture(modelPath));
}
if (player) {
node->setScale(irr::core::vector3df(scale[SCALING], scale[SCALING], scale[SCALING]));
node->setRotation(irr::core::vector3df(scale[ROTX], scale[ROTY], scale[ROTZ]));
node->setPosition(irr::core::vector3df(scale[TRAX], scale[TRAY], scale[TRAZ]));
cControl->InitCameraPosition(scale[CAMX], scale[CAMY], scale[CAMZ]);
} else {
node->setScale(irr::core::vector3df(scale[SCALING], scale[SCALING], scale[SCALING]));
node->setRotation(irr::core::vector3df(scale[ROTX], scale[ROTY] + 180.0, scale[ROTZ]));
node->setPosition(irr::core::vector3df(scale[TRAX] - 15.0, scale[TRAY] + 5.0, scale[TRAZ] + 200));
}
}