example of OBJ file reading

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
husqvarna
Posts: 39
Joined: Thu Mar 09, 2006 9:37 am

example of OBJ file reading

Post by husqvarna »

Hello,

I'm searching an example code of OBJ file reading and display. Code and OBJ file.

If you have one, please send me a mail (publicite@davidimboden.net) with code and the obj file.

If possible for .net version.

Thanks a lot
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

read the examples.

getMesh("file.obj")
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
husqvarna
Posts: 39
Joined: Thu Mar 09, 2006 9:37 am

Post by husqvarna »

and how to display? i give de input, but see nothing.

Code juste under:
Last edited by husqvarna on Mon Mar 13, 2006 3:35 pm, edited 1 time in total.
Guest

code

Post by Guest »

Hello,

I do that, but nothing on the screen, what's wrong? Please.

Code: Select all

IrrlichtDevice *device =
	reateDevice(driverType, core::dimension2d<s32>(640, 480));

	if (device == 0)
		return 1; // could not create selected driver.

= device->getVideoDriver();
	scene::ISceneManager* smgr = device->getSceneManager();


	scene::IAnimatedMesh* mesh = smgr->getMesh("MayaTest.obj");

	scene::ISceneNode* node = 0;
	
	if (mesh)
	node = smgr->addOctTreeSceneNode(mesh->getMesh(0));

	smgr->addCameraSceneNodeFPS();
	device->getCursorControl()->setVisible(false);

	int lastFPS = -1;

	while(device->run())
	if (device->isWindowActive())
	{
		driver->beginScene(true, true, video::SColor(0,200,200,200));
		smgr->drawAll();
		driver->endScene();

		int fps = driver->getFPS();

		if (lastFPS != fps)
		{
			core::stringw str = L"test obj [";
			str += driver->getName();
			str += "] FPS:";
			str += fps;

			device->setWindowCaption(str.c_str());
			lastFPS = fps;
		}
	}

	device->drop();
	
	return 0;
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

Post by bearSoft »

try to look at ur console. propl theres an error in load of either mesh or textures

OR!! -the mesh -is- loaded but it is either scaled to big -eg cam are -in- it and therefore nothing is seen -or it is scaled to smal and need to upscaled before it is visible
-both are very common 'problems'

-real- problems are different ;)
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Post Reply