Hi, I'm sorry if the information I provide isn't enough, but I'm exhausted after searching my mistake... so please help me.
After reading this article
http://irrlicht.sourceforge.net/docu/example003.html
and this one
http://de.wikibooks.org/wiki/Irrlicht_- ... _verwenden
(German Wikibooks)
I created a Custom Scene node, CUnit, which inherits ISceneNode, just like the CWuerfel in the Second link.
It works fine to be displayed (and makes it ease for me to display a quboid and not a cube...)
but:
1.)
It is displayed with fancy colors (which are set in the example code), but I am not able to assign a material (png file) to it.
2.)
Before making that class I used ISceneCollisionManager 's function getSceneNodeAndCollisionPointFromRay
which doesn't select anything now...
So... which function or property do I have to set or add,...
could someone please help me?
If the provided information isn't enough, please tell me, but if you need source, the second link should be enough (though it's German)
Thanks!
ISceneCollisionManager+Custom SceneNode (+Material question)
What is the problem? What code are you using to assign the png texture to the object? Should be something like:1.)
It is displayed with fancy colors (which are set in the example code), but I am not able to assign a material (png file) to it.
mat->setTexture(0,<texture>)
<texture> being one you loaded previously with driver->getTexture(<filename>);
If you generate the vertices yourself you will also need to set texture coordinates for each and every vertex:
//Vorne
cwVertices[0] = S3DVertex(fMaxLinks, fMaxUnten, fMaxVorne,0,0,0,SColor(255,255,0,0),0,0); //Punkt A
the last 2 parameters 0,0 are your u and v tex coords.