Hello,
I am basicly just trying to control a node that is created in a .irr scene. Just so I know what I am doing, I am just trying to have a sphere created in IrrEdit rotate. The concerning code is right here:
I did not post the whole code because they are irrelevant. I am assuming the problem lies when I initialize sphere1 and/or when I try to set the rotation. The code does run fine If I leave the setRotation() code, but I am not confident that I did the whole process correctly since I am still iffy with pointer stuff.. If somebody can correct me, it would be very much appreciated. Thank you!!
ken
What's the exact problem? No rotation? Crash? For finding a single node in an irr scene I don't iterate the scene, I just use the "getSceneNodeFromName" or "...fromID" in (IIRC) ISceneManager. You just have to give a name (or an ID) to your sphere for that method, and (of course) check the returned pointer for NULL.
Brainsaw wrote:What's the exact problem? No rotation? Crash? For finding a single node in an irr scene I don't iterate the scene, I just use the "getSceneNodeFromName" or "...fromID" in (IIRC) ISceneManager. You just have to give a name (or an ID) to your sphere for that method, and (of course) check the returned pointer for NULL.
thank you for replying. Sorry I left out the exact problem. The program crashes when I have the setRotation() code in there. So I would add a name/ID to the sphere in irrEdit, then use either function to set it? eg: can I do something like (pseudo):
ISceneNode* sphere = getSceneNodeFromName("name_of_sphere");
hmm... thank you, I got it it to run without crashing now. However, now, the sphere is not lighted for some reason, all though there are lights in the scene (created using irrEdit, I did not set the lights in the programming), and it does not seem to be rotating. Any thoughts? The code is still the same, just I have changed
Are the node's material parameters correct? Just trace them to the console for testing. If that doesn't work check for all parameters of the light source.