Graphics Not Displaying

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mager
Posts: 24
Joined: Thu Jul 22, 2010 11:55 pm

Graphics Not Displaying

Post by mager »

So, I'm writing my game engine - and i was working with adding an eventhandler and suddenly my graphics quit displaying. I know its running through my draw and update functions, but its not displaying.

Can you guys help me figure out what the problem is?

Here is the source code to my engine:
http://filebeam.com/08e51ed85e006c7ec3f8f1faa576b1de
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Looking into your 3DModel.cpp:
in Model3D::Load() you do loading a model like:

Code: Select all

mesh = smgr->getMesh(file);
node = smgr->addAnimatedMeshSceneNode(mesh);
then in Model3D::Unload() you do unloading like:

Code: Select all

mesh->drop();
node->drop();
How can you write 0 "create" methods and 2 "drop" method ?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

it seems the problem is with your camera's target... :shock:
if you (eg.) set the camera's position a bit behind the target it seems to work:

Code: Select all

void Player::UpdateVariables(ICameraSceneNode * cam){
	Model3D::GetMeshNode()->setPosition(Position);
	cam->setTarget(Position);
	cam->setPosition(Position - vector3df(0,0,1));
}
and greenya is right, you should not drop node and mesh !!! :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
mager
Posts: 24
Joined: Thu Jul 22, 2010 11:55 pm

Post by mager »

Whats the proper way to delete a mesh or node?

And whats the cameras position have to do with even my skybox not displaying?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

mager wrote:Whats the proper way to delete a mesh or node?
node->remove(); and MeshCache->removeMesh(mesh);
mager wrote:And whats the cameras position have to do with even my skybox not displaying?
if the camera's target is equal to it's position it can do strange things with the visualisation... ;)
mybe you could say then it looks into itself tho... :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
mager
Posts: 24
Joined: Thu Jul 22, 2010 11:55 pm

Post by mager »

Well, With absolutely no explanations. It works again.

I replaced my stationary camera with an FPS camera and ran it, then it worked. I set the stationary back again and it still works? With all of the code functional now. Frankly I'm confused, but hey its working.
Post Reply