My project requires drawing a cube with different textures set to each of the cube surfaces. I created a customized scene node by extending ISceneNode. But I am wondering how I can set different textures to each of the cube surfaces instead of using the same one for all surfaces. Can anybody give me some clues?
No, I generally don't post code here. It either raises several new questions (due to lack of understanding) or just reduces your amount of work while increasing mine (but results would be the same). So in order to distribute the amount of work appropriately and to ensure some learning effect I'll just point you to some places where to find hints or code.
Create new SMeshBuffers where you store vertices and indices (the values are just as in the custom scene node example). Each mesh buffer can hold arbitrary triangle faces with the same material. When done with adding faces you add the mesh buffer to your mesh with addMeshBuffer().
Materials in Irrlicht are based on SMaterial, so read the API for that. You can access the Material of Mesh buffers directly via meshBuffer.Material.
If you need some real code examples read the mesh loader code for any of the supported formats. These use mesh buffers and different materials per mesh.
Thank you, hybrid. Your reply is much more valuable than several lines of code because it points to the direction that I should go and infomation that I should check. I'm going to get more than what I have expected by following your advice.
By the way, what is the best way to learn Irrlicht? I have gone through all the examples line by line. I also played with the demo code. What should I do next?
I have long time Java experience but mainly on Web app development. My C++ is OK. I had some expose to CAD.
I have tried Java Monkey Engine but I was not satisfied with its performance. Then I cam across with Irrlicht. Irrlicht has everything that I need. But what is the best way to grab its power? Is there any boook that I can refer to? Or should I learn through the forum?
Hmm, good question. I've learned Irrlicht by slowly extending my own project with several features and thus learning how to use them. So basically playin around with new things until they work. And I've read many source files from apps based on Irrlicht (usually while fixing compile problems under Linux )
Lately I've written some mesh file loaders which introduced some Irrlicht core techniques to me (and that's why I'd suggest to look into mesh file loader code to understand mesh buffers and such things).