3ds on Visual Studio 2015

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
Dénésys
Posts: 4
Joined: Thu Jun 02, 2016 11:43 am

3ds on Visual Studio 2015

Post by Dénésys »

Hello,

I'm tryng to make my program cross-plateform Linux/Windows.
So I use Visual Studio 2015 update 2 and in my program I use .3ds file for my mesh. I read on internet that use .3ds file on visual studio is impossible is it true ?
Is there any easy way to cross-plateform this ?
I tell that because when I do "getMesh()" on windows it return NULL...

Thank for your help.

Dénésys
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: 3ds on Visual Studio 2015

Post by CuteAlien »

You don't use .3ds on VisualStudio itself. What you do is use VisualStudio to write programs which are using models in the 3ds format. And in your programs you can always do whatever you want, that's the power of coding :-)
Irrlicht supports 3ds format somewhat I think (I never used it myself), so you should be able to load it. If you get a null pointer check for errors in the log. For a first test you can use the MeshLoader example (no. 9) and load the mesh in there.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Dénésys
Posts: 4
Joined: Thu Jun 02, 2016 11:43 am

Re: 3ds on Visual Studio 2015

Post by Dénésys »

Of cours you're right but I use the exactly same code in Unix and Visual Studio. The only thing that can change is the path and I write the absolute path in the code.

So I write this:

Code: Select all

this->hey = new MyEventReceiver;
this->menuDevice = createDevice(irr::video::EDT_BURNINGSVIDEO,
                  irr::core::dimension2d<irr::u32>(1920, 1080),
                  32, false, false, false, this->hey);
this->device = this->menuDevice;
this->smgr = this->device->getSceneManager();
this->mesh = this->smgr->getMesh("C:\Users\Dénésys\media\idle.3ds");
this->node = this->smgr->addMeshSceneNode(this->mesh);
Tell me if I do something wrong ...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: 3ds on Visual Studio 2015

Post by CuteAlien »

You have to look at the output of the console window. It should have some comment about that.
Maybe there's a problem with the special characters in Dénésys (just guessing here...).

Also as I see you're using BURNINGSVIDEO - that's just a software renderer. For 3D you should probably use some renderer using your 3D card like OpenGL.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Dénésys
Posts: 4
Joined: Thu Jun 02, 2016 11:43 am

Re: 3ds on Visual Studio 2015

Post by Dénésys »

I would check for using a 3D card like OpenGL
It can be the solution ?

Else special characters in Dénésys isn't the problem.. And the output console window is empty, I have got a windows which say : Exception at 0x01289D60 in test.exe : 0xC0000005 : Access violation during lecture of emplacement 0x00000000.

Beacause next I do :

Code: Select all

this->node->setMaterialFlag(irr::video::EMF_LIGHTING, false);
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: 3ds on Visual Studio 2015

Post by mongoose7 »

You can't write filenames like this: this->mesh = this->smgr->getMesh("C:\Users\Dénésys\media\idle.3ds");
'\' is a 'C' escape. Either use '\\' or '/'. You can always use '/' in Windows and Linux.
You also have to check the return value from functions.
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: 3ds on Visual Studio 2015

Post by Cube_ »

I really would recommend you change your filepaths to /

First of all \ escapes so \Users becomes \U (unknown escape?) sers \D (wat?) etc etc. You have to escape the \ if you are so inclined but / is the platform agnostic way to specify paths anyway and the way it's traditionally done under unices of all flavors. Windows supports it presumably for compatibility reasons.
"this is not the bottleneck you are looking for"
Dénésys
Posts: 4
Joined: Thu Jun 02, 2016 11:43 am

Re: 3ds on Visual Studio 2015

Post by Dénésys »

Right I see that and I change but still doesn't work.
So I change my file "idle.3ds" by a .x and it compile ... Very strange problem...

Other problem a windows opens and nothing apear...
It's very difficule to adapte irrlicht from Linux !
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: 3ds on Visual Studio 2015

Post by Cube_ »

I don't know how well irrlicht supports 3ds but there are a variety of other far more supported formats like .x and .m3d, any format irrlicht supports naturally works on any platform irrlicht works on, be it linux, windows, mac, or some more exotic unix flavor (solaris?)
"this is not the bottleneck you are looking for"
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: 3ds on Visual Studio 2015

Post by mongoose7 »

Is the mesh loaded? Do you check?
You also have an accented character in the file name - is it Latin-1, Unicode or UTF-8?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: 3ds on Visual Studio 2015

Post by CuteAlien »

Ah - I missed the escape characters in filename :-) But anyway - I still have the same 2 hints as above:
1. Check the console output - it should give an error when something doesn't load
2. Try to load it in the meshloader example to see if it's a problem with the model or your code.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply