I can't load x file(that animate). Can anybody help me?

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
fon3m
Posts: 32
Joined: Thu Sep 28, 2006 9:34 pm

I can't load x file(that animate). Can anybody help me?

Post by fon3m »

I use this code

Code: Select all

#include <irrlicht.h>

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#pragma comment(lib, "Irrlicht.lib")

int main()
{
	IrrlichtDevice *device =
		createDevice( video::EDT_SOFTWARE2, dimension2d<s32>(640, 480), 16,
			false, false, false, 0);

	device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");

	guienv->addStaticText(L"Hello World! This is the Irrlicht Apfelbaum Software renderer!",
		rect<int>(10,10,260,22), true);

	
	IAnimatedMesh* mesh = smgr->getMesh("media/d1.x");
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

	
	if (node)
	{
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setMaterialTexture( 0, driver->getTexture("media/v4.bmp") );
		node->setFrameLoop(0, 100);
		node->setAnimationSpeed(80);

		node->setRotation(core::vector3df(0,0.0f,180));	
	}

	smgr->addCameraSceneNode(0, vector3df(0,0,500), vector3df(-90,0,0));

	while(device->run())
	{
		driver->beginScene(true, true, SColor(255,100,101,140));

		smgr->drawAll();
		guienv->drawAll();

		driver->endScene();
	}

	device->drop();

	return 0;
}
what anything wrong? Please help me.

Thank you very much.
fon3m
Posts: 32
Joined: Thu Sep 28, 2006 9:34 pm

Post by fon3m »

It's show model that have texture only (didn't animate)

and if i have many texture how can i load that texture.

thank you.
fon3m
Posts: 32
Joined: Thu Sep 28, 2006 9:34 pm

Post by fon3m »

and my model have many joint. How I load their joint.

Thanks
niezdrowywglowe
Posts: 8
Joined: Fri Oct 13, 2006 9:31 pm

Post by niezdrowywglowe »

I have similar problem. When I load a mesh, there is only black screen. What modeller are You using? Take a look on my post:

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=16306
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Code: Select all

smgr->addCameraSceneNode(0, vector3df(0,0,500), vector3df(-90,0,0)); 
You're position your camera at +500 Z and then telling it to look at -90, maybe the model is too small to be in the View. Try setting your lookat to 0,0,0. Also, scale your model, maybe it's really small,
Image
Post Reply