我正在学习使用
Irrlicht on Android.上个月我一直在研究基于openGL es 1.0的驱动程序,它运行良好(我使用1.0,因为当我尝试运行基于驱动程序es 2.0的示例时,结果结果非常好奇怪).加载网格是可以的,但令我困惑的是纹理无法正确显示.
渲染代码如下:
渲染代码如下:
smgr = device->getSceneManager(); guienv = device->getGUIEnvironment(); stringc myDir = gSdCardPath; myDir += "/Irrlicht"; device->getFileSystem()->changeWorkingDirectoryTo(myDir.c_str()); stringc sydneyFilename = "/Irrlicht/sydney.md2"; mesh=smgr->getMesh("/sdcard/Irrlicht/sydney.md2"); if (!mesh) { device->drop(); __android_log_print(ANDROID_LOG_INFO,"Irrlicht","cannot getMesh"); return; } nodeSydney = smgr->addAnimatedMeshSceneNode(mesh); if (nodeSydney) { nodeSydney->setMaterialFlag(EMF_LIGHTING,false); nodeSydney->setMD2Animation(scene::EMAT_STAND); stringc sydneyTextureFilename = "/Irrlicht/sydney.bmp"; texture=driver->getTexture("/sdcard/Irrlicht/sydney.bmp"); if (!texture) LOGI("sydney.bmp load Failed"); else{ nodeSydney->setMaterialTexture(0,texture); LOGI("sydney.bmp load successfully"); } nodeSydney->setPosition(core::vector3df(0.0f,0.0f,0.0f)); } smgr->addCameraSceneNode(0,vector3df(0,10,-50),5,0)); receiver = new AndroidEventReceiver(context); device->setEventReceiver(receiver);
除了删除的注释和节点的位置之外,一切都与原始代码相同,我也确信代码中所需的文件位于正确的目录中.
任何在Android上使用Irrlicht的人都可以帮助我吗?