3D studio Max helping with codeing

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.
jimowns
Posts: 62
Joined: Thu Sep 28, 2006 5:28 pm
Location: X-Gamers

3D studio Max helping with codeing

Post 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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Irrlicht doesn't support .max, you'll have to export it to a different file format, such as .3ds
Image Image Image
jimowns
Posts: 62
Joined: Thu Sep 28, 2006 5:28 pm
Location: X-Gamers

Post by jimowns »

how can i do that ?
i can choas only .max , chr files .

i used 3D studio max 7
rimbou
Posts: 20
Joined: Fri Nov 24, 2006 12:09 pm

Post 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
Last edited by rimbou on Fri Feb 18, 2011 6:07 pm, edited 1 time in total.
jimowns
Posts: 62
Joined: Thu Sep 28, 2006 5:28 pm
Location: X-Gamers

Post by jimowns »

its says now no data to Export .
rimbou
Posts: 20
Joined: Fri Nov 24, 2006 12:09 pm

Post 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
Last edited by rimbou on Fri Feb 18, 2011 6:07 pm, edited 1 time in total.
jimowns
Posts: 62
Joined: Thu Sep 28, 2006 5:28 pm
Location: X-Gamers

Post 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
rimbou
Posts: 20
Joined: Fri Nov 24, 2006 12:09 pm

Post 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
Last edited by rimbou on Sat Mar 12, 2011 6:06 am, edited 1 time in total.
jimowns
Posts: 62
Joined: Thu Sep 28, 2006 5:28 pm
Location: X-Gamers

Post 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 :)
jimowns
Posts: 62
Joined: Thu Sep 28, 2006 5:28 pm
Location: X-Gamers

Post 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).
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post 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") );
 } 
}
jimowns
Posts: 62
Joined: Thu Sep 28, 2006 5:28 pm
Location: X-Gamers

Post by jimowns »

i changed the code in our code and haveing the same issue.
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

uh yeah... give a try and set the following line as comment

Code: Select all

node->setMD2Animation ( scene::EMAT_STAND );
jimowns
Posts: 62
Joined: Thu Sep 28, 2006 5:28 pm
Location: X-Gamers

Post 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 .
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post 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.
Post Reply