tutorial 3 not working
tutorial 3 not working
hello everyone
The 3rd tutorial for some reason is not working for me and i can't find any forum questions for it.
i have typed it out exactly like it is done in the tutorial but when i try to compile it i get over 20 errors most being towards the render virtual function because the scene manager is an undecleared identifier
also the isceneNode does not have any onPreRender function ???
and the final thing is that when i create my sample node it says it cannot instantiate abstract class.
i don't know what is going on or what i have done wrong but please help cause it's really ticking me off
The 3rd tutorial for some reason is not working for me and i can't find any forum questions for it.
i have typed it out exactly like it is done in the tutorial but when i try to compile it i get over 20 errors most being towards the render virtual function because the scene manager is an undecleared identifier
also the isceneNode does not have any onPreRender function ???
and the final thing is that when i create my sample node it says it cannot instantiate abstract class.
i don't know what is going on or what i have done wrong but please help cause it's really ticking me off
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: tutorial 3 not working
Make it work for you! Slap it upside the head and make it your beeyatch.Tubby2877 wrote:The 3rd tutorial for some reason is not working for me
Questions:Tubby2877 wrote:i have typed it out exactly like it is done in the tutorial but when i try to compile it i get over 20 errors most being towards the render virtual function because the scene manager is an undecleared identifie
Why are you "[typing] it out"?
Can you build and run the original, unchanged example project? Have you tried?
What errors do you get, in either case? Don't make us guess, tell us.
What version of Irrlicht are you using, and what platform / compiler / IDE?
If your code is still relatively short, consider posting it in its entirety. We're not telepathic. Well, Vitek might be, but we're keeping that quiet.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Re: tutorial 3 not working
Have you tested the development and build environment? That's one of the uses of the sample code given. Also, posting error messages and/or code is very helpful, rather than stating what went wrong.Tubby2877 wrote:hello everyone
The 3rd tutorial for some reason is not working for me and i can't find any forum questions for it.
i have typed it out exactly like it is done in the tutorial but when i try to compile it i get over 20 errors most being towards the render virtual function because the scene manager is an undecleared identifier
also the isceneNode does not have any onPreRender function ???
and the final thing is that when i create my sample node it says it cannot instantiate abstract class.
i don't know what is going on or what i have done wrong but please help cause it's really ticking me off
A wild guess: did you use the examples from the web page (they're out of date) ?!?!?
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Code and errors
so this is the code and it looks identical to the example code that is in the file as far as i can see. I tried to run the example code and it does work so i can't understand what i am doing wrong.
i did use the tutorial of the main website but if there is a better place to get the tutorials from please fill me in
Thanks for all the help
and these are the main errors the rest of the errors are just repeats of these.
Error 8 error C2040: 'vDriver' : 'int' differs in levels of indirection from 'irr::video::IVideoDriver *'
Error 4 error C2065: 'SceneManager' : undeclared identifier
Error 21 error C2259: 'CSampleSceneNode' : cannot instantiate abstract clas
i did use the tutorial of the main website but if there is a better place to get the tutorials from please fill me in
Thanks for all the help
Code: Select all
#include <irrlicht.h>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
//For the created scene node to be inserted into the engine, the class needs to be dirived from the iscenenode class
class CSampleSceneNode : public scene::ISceneNode
{
core::aabbox3d<f32> Box;
video::S3DVertex Verticies[4];
video::SMaterial Material;
public:
CSampleSceneNode(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id)
: scene::ISceneNode(parent,mgr,id)
{
Material.Wireframe = false;
Material.Lighting = false;
Verticies[0] = video::S3DVertex(0,0,10,1,1,0,video::SColor(255,0,255,255),0,1);
Verticies[1] = video::S3DVertex(10,0,-10,1,0,0,video::SColor(255,255,0,255),1,1);
Verticies[2] = video::S3DVertex(0,20,10,0,1,1,video::SColor(255,255,255,0),1,0);
Verticies[3] = video::S3DVertex(-10,0,-10,0,0,1,video::SColor(255,0,255,0),0,0);
Box.reset(Verticies[0].Pos);
for(s32 i = 1; i < 4; ++i)
Box.addInternalPoint(Verticies[i].Pos);
}
virtual void OnRegisterSceneNode()
{
if(IsVisible)
SceneManager->registerNodeForRendering(this);
ISceneNode::OnRegisterSceneNode();
}
virtual void render()
{
u16 indices[] = {0,2,3, 2,1,3, 1,0,3 2,0,1};
video::IVideoDriver* vDriver = SceneManager->getVideoDriver();
vDriver->setMaterial(Material);
vDriver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
vDriver->drawIndexedTriangleList(&vertices[0],4, &indices[0], 4);
}
virtual const core::aabbox3d<f32>& GetBoundingBox() const
{
return Box;
}
virtual s32 getMaterialCount()
{
return 1;
}
virtual video::SMaterial& getMaterial(s32 i)
{
return Material;
}
};
int main()
{
IrrlichtDevice* tDevice = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640,480),16,false);
tDevice->setWindowCaption(L"Custom Scene Node - Irrlicht Engine Demo");
video::IVideoDriver* vDriver = tDevice->getVideoDriver();
scene::ISceneManager* sSceMan = tDevice->getSceneManager();
sSceMan->addCameraSceneNode(0, core::vector3df(0,-40,0), core::vector3df(0,0,0));
CSampleSceneNode *MyNode = new CSampleSceneNode(sSceMan->getRootSceneNode(), sSceMan, 666);
MyNode->drop();
scene::ISceneNodeAnimator* anim = sSceMan->createRotationAnimator(core::vector3df(0.8f, 0, 0.8f));
MyNode->addAnimator(anim);
anim->drop();
while(tDevice->run())
{
vDriver->beginScene(true,true, video::SColor(0,100,100,100));
sSceMan->drawAll();
vDriver->endScene();
}
tDevice->drop();
return 0;
}
Error 8 error C2040: 'vDriver' : 'int' differs in levels of indirection from 'irr::video::IVideoDriver *'
Error 4 error C2065: 'SceneManager' : undeclared identifier
Error 21 error C2259: 'CSampleSceneNode' : cannot instantiate abstract clas
thank you for the help have corrected that error
and the const is after just how it is like in the example
unfortunatly that still hasn't helps and i am stillgetting the same errors as above
and the const is after just how it is like in the example
Code: Select all
virtual u32 getMaterialCount() const
{
return 1;
}
virtual video::SMaterial& getMaterial(u32 i)
{
return Material;
}
have gone though it line by line with the example and fixed the abstract class, it was because an o was a capital instead of lowercase
The rest of the errors have something to do with the scenemanager in the render() function.
for some reason it is being classed as an undecleared identifier and so the intellisence isn't working.
This is what is going wrong!!!
for some reason the scenemanager above in the OnRegisterSceneNode() works fine but the render() dosn't.
i copied and pasted the example one into this project to see if it was something i left out but it worked so it is something within the code and i went though line by line but i can't see a difference.
a second pair of eyes would be handy that you. and before you say it, i know the driver pointer and scenemanager pointer variables are named different but that shouldn't effect it if they are all named in that way, at least what i know it shouldn't.
Thanks for all the help
The rest of the errors have something to do with the scenemanager in the render() function.
for some reason it is being classed as an undecleared identifier and so the intellisence isn't working.
This is what is going wrong!!!
for some reason the scenemanager above in the OnRegisterSceneNode() works fine but the render() dosn't.
i copied and pasted the example one into this project to see if it was something i left out but it worked so it is something within the code and i went though line by line but i can't see a difference.
a second pair of eyes would be handy that you. and before you say it, i know the driver pointer and scenemanager pointer variables are named different but that shouldn't effect it if they are all named in that way, at least what i know it shouldn't.
Thanks for all the help
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Ah, right.
In your Irrlicht SDK, there's an examples directory. The examples in there are far more likely to be up to date and correct than anything you'll find on a web page.
In your Irrlicht SDK, there's an examples directory. The examples in there are far more likely to be up to date and correct than anything you'll find on a web page.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way