Horde3D
http://horde3d.org/forums/

Run Horde3D from an external program
http://horde3d.org/forums/viewtopic.php?f=2&t=736
Page 1 of 1

Author:  Panama [ 11.05.2009, 13:56 ]
Post subject:  Run Horde3D from an external program

Hi guys!
Is it possible to run Horde from an external program?
In my case the datas are calculated in Matlab iteratively and I wanna give Horde3D for every timestep new datas?
Any suggestions?
Thanks a lot!

Author:  Volker [ 11.05.2009, 15:06 ]
Post subject:  Re: Run Horde3D from an external program

No need for an external program, you can load the Horde3D DLL directly into Matlab.
See this page for an example.

Author:  Panama [ 11.05.2009, 22:15 ]
Post subject:  Re: Run Horde3D from an external program

So as I understood it, I can load the libaries from Horde into Matlab and can run from there any functions (by using calllib) of the engine?


I tried it in that way from the example:

%% Load the library from dll
loadlibrary Horde3D.dll
calllib('Horde3D','methodname')

disp('Call to C DLL:');
tic; calllib('Horde3D','methodname'); toc

But I have problems with the 'calllib'. It never finds the method.
Can someone give me an easy example for running a sample -like knight- from matlab?

Author:  Volker [ 11.05.2009, 22:23 ]
Post subject:  Re: Run Horde3D from an external program

Running the knight sample and calling Horde3D functions are two different aspects. The knight demo is a C++ application while the Horde3D library is a DLL with C functions. I don't have a Matlab installation available so I can't test it myself. But I guess google should help you finding a working example how to load a DLL and call an exportet method from it.

Author:  Panama [ 12.05.2009, 10:43 ]
Post subject:  Re: Run Horde3D from an external program (MATLAB)

I got it.
I can use all the functions from matlab.
But the thing is that I modified allready a sample in VisualC++ and wanna run it in Matlab.
So it would be easier to write a Mex file and load Horde in here, instead of writing everything new with 'callib'.
So how can I run a sample in Matlab.

Btw when I load the dll in Matlab the functions came out binary. (.obj)

Author:  Volker [ 12.05.2009, 10:54 ]
Post subject:  Re: Run Horde3D from an external program

One straight forward approach would be converting the sample to a DLL and write C functions that can be exported from it to allow interaction with the sample. But there may be other possibilities, like adding command line parameters and run the application using something like dos/unix from matlab. Don't know, maybe it's also possible to create an OpenGL context in Matlab and port the sample to it.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/