Page 1 of 2

3D studio Max helping with codeing

Posted: Wed Dec 13, 2006 5:55 pm
by jimowns
hey
i have a little problem with my test.max file .
i whont to load it intro my source code .
but i dont know whats the code is .
can someone helping me .

i whont to load it in this source 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>(1270, 1024), 16,
			false, false, false, 0);

	device->setWindowCaption(L"Test met wapen een AK47");

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	IGUIEnvironment* guienv = device->getGUIEnvironment();

	guienv->addStaticText(L"Hello mijn eerste script in irrlicht .",
		rect<int>(20,20,260,322), true );


//-------------------------------------------------------- dit is voor BMP 3D bij te voegen ----------

    IAnimatedMesh* mesh = smgr->getMesh("Guns/weapon2.md2");
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );


	if (node)
	{
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setMD2Animation ( scene::EMAT_STAND );
		node->setMaterialTexture( 0, driver->getTexture("Guns/weapon2.bmp") );
	}
                                      // ( ,50, = het draaien van screen 
	smgr->addCameraSceneNode(0, vector3df(50,50,-40), vector3df(0,5,0));
//-----------------------------------------------------------------------------------
	while(device->run())
	{
		
		driver->beginScene(true, true, SColor(255,100,101,140));

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

		driver->endScene();
	}

	device->drop();

	return 0;
}




thanks on advance

Posted: Wed Dec 13, 2006 5:56 pm
by JP
Irrlicht doesn't support .max, you'll have to export it to a different file format, such as .3ds

Posted: Wed Dec 13, 2006 6:04 pm
by jimowns
how can i do that ?
i can choas only .max , chr files .

i used 3D studio max 7

Posted: Wed Dec 13, 2006 7:13 pm
by rimbou
jimowns wrote:how can i do that ?
i can choas only .max , chr files .

i used 3D studio max 7
Use Export and not Save As.
________
SEX TUBE

Posted: Wed Dec 13, 2006 7:20 pm
by jimowns
its says now no data to Export .

Posted: Wed Dec 13, 2006 7:30 pm
by rimbou
jimowns wrote:its says now no data to Export .
You only get that message when you try to export an empty scene, so open your .max file first :P
________
Oxycontin rehab forum

Posted: Wed Dec 13, 2006 7:40 pm
by jimowns
no have the same error .

first i made a car .
then i save it in scene .
and try to export in 3ds .

and have the error again .

i'm a realy noob in those things :p

Posted: Wed Dec 13, 2006 7:46 pm
by rimbou
It works for me. This is what I did:
1) Open MAX.
2) Make a cube.
3) Export.
4) Choose .3ds and give the file a name.

And that's all.
________
Yamaha Motif

Posted: Wed Dec 13, 2006 7:55 pm
by jimowns
i solve it , got someting wrong with my 3d studio max 7 , i reinstal it and now its works .

thanks for our help :)

Posted: Thu Dec 14, 2006 1:29 pm
by jimowns
now i've a new problem .
i maded a aim_map1.3ds file and know i whont to load it intro my code , and its gives me much errors . and realy dont know whats wrong in my source code.

here is my 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") // dit wilt zeggen dat ik een lib bestand moet hebben en een dll 

int main()
{

	IrrlichtDevice *device =
		createDevice( video::EDT_SOFTWARE2, dimension2d<s32>(1270, 1024), 16,
			false, false, false, 0);

	device->setWindowCaption(L"Test met wapen een AK47");

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	IGUIEnvironment* guienv = device->getGUIEnvironment();

	guienv->addStaticText(L"Hello mijn eerste script in irrlicht .",
		rect<int>(20,20,260,322), true );


//-------------------------------------------------------- dit is voor BMP 3D bij te voegen ----------

    IAnimatedMesh* mesh = smgr->getMesh("maps/aim_map1.3ds");
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );


	if (node)
	{
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setMD2Animation ( scene::EMAT_STAND );
		node->setMaterialTexture( 0, driver->getTexture("maps/aim_map1.jpg") );
	}
                                      // ( ,50, = het draaien van screen 
	smgr->addCameraSceneNode(0, vector3df(50,50,-40), vector3df(0,5,0));
//------------------------------------------------------------------------------------------------------
	while(device->run())
	{
		
		driver->beginScene(true, true, SColor(255,100,101,140));

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

		driver->endScene();
	}

	device->drop();

	return 0;
}

and here is my error :

Code: Select all

'Project1.exe': Loaded 'C:\Documents and Settings\Eigenaar\Bureaublad\C++ codes\Hello script in irrlicht\debug\Project1.exe', Binary was not built with debug information.
'Project1.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\Documents and Settings\Eigenaar\Bureaublad\C++ codes\Hello script in irrlicht\Project1\Irrlicht.dll', Binary was not built with debug information.
'Project1.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\glu32.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\shimeng.dll', No symbols loaded.
'Project1.exe': Unloaded 'C:\WINDOWS\system32\shimeng.dll'
Irrlicht Engine version 1.1
Microsoft Windows XP Personal Service Pack 2 (Build 2600)
'Project1.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'Project1.exe': Loaded 'C:\WINDOWS\system32\MSCTF.dll', No symbols loaded.
Loaded texture: #DefaultFont
First-chance exception at 0x100555a8 in Project1.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x100555a8 in Project1.exe: 0xC0000005: Access violation reading location 0x00000000.
First-chance exception at 0x100555a8 in Project1.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x100555a8 in Project1.exe: 0xC0000005: Access violation reading location 0x00000000.
The program '[3772] Project1.exe: Native' has exited with code 0 (0x0).

Posted: Thu Dec 14, 2006 1:37 pm
by sdi2000
check if your mesh pointer is valid before you add as scenenode.

Code: Select all

IAnimatedMesh* mesh = smgr->getMesh("maps/aim_map1.3ds"); 
if(mesh)
{
 IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

 if (node)
 {
    node->setMaterialFlag(EMF_LIGHTING, false);
    node->setMD2Animation ( scene::EMAT_STAND );
    node->setMaterialTexture( 0, driver->getTexture("maps/aim_map1.jpg") );
 } 
}

Posted: Thu Dec 14, 2006 1:44 pm
by jimowns
i changed the code in our code and haveing the same issue.

Posted: Thu Dec 14, 2006 2:01 pm
by sdi2000
uh yeah... give a try and set the following line as comment

Code: Select all

node->setMD2Animation ( scene::EMAT_STAND );

Posted: Thu Dec 14, 2006 2:10 pm
by jimowns
nothing .

i download a impreza_3ds.3ds file from this forum under the topic 3DS Race track model needed.
and its working with that file , but not the file if maded one .

Posted: Thu Dec 14, 2006 2:21 pm
by sdi2000
okay it seems that your file is corrupt. try to load/import them in milkshape or any other 3d editor.
or load the file up that someone can have a look where the problem is.