providing a C interface for Ogre3D
-
- Gnoblar
- Posts: 3
- Joined: Sat May 28, 2005 5:11 pm
- Location: Belgium
- Contact:
providing a C interface for Ogre3D
I'm planning to set up a project to build a 3D modeller in Haskell, and I might use Ogre3D as render engine. The only problem is, Haskell can only use C functions, so I would need a C interface to Ogre3D. I heard a rumor that someone was willing to write this, but nobody seems to remember who he/she was
http://haskell.org/hawiki/H3D
Does anyone in here want to help building a C interface for Ogre3D ?
http://haskell.org/hawiki/H3D
Does anyone in here want to help building a C interface for Ogre3D ?
There are only 10 kinds of people in the world, those who know binary and those who don't
- LordMyth
- Gremlin
- Posts: 181
- Joined: Thu Jan 06, 2005 10:19 pm
- Location: Belgium
- Contact:
May I ask why you want to go with the Haskell programming language?
I mean, it's probably faster to program your modeler in C++ or C# then converting OGRE to C (crazy idea if you ask me) and then using it in Haskell.
I mean, it's probably faster to program your modeler in C++ or C# then converting OGRE to C (crazy idea if you ask me) and then using it in Haskell.
Have a kiss from me!
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
@LordMyth:
There's absolutely no point in this - we choose what we choose - it's a matter of personal preferences.
@boegel:
I sincerely hope you find a solution!
A C-wrapper for Ogre could be useful for a lot of other things..
There's absolutely no point in this - we choose what we choose - it's a matter of personal preferences.
@boegel:
I sincerely hope you find a solution!
A C-wrapper for Ogre could be useful for a lot of other things..
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
I care about not reading language wars, that's all.
Other than that, I don't give a shit.
Other than that, I don't give a shit.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- LordMyth
- Gremlin
- Posts: 181
- Joined: Thu Jan 06, 2005 10:19 pm
- Location: Belgium
- Contact:
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Merely a reply to xavier's polite question.xavier wrote:And unless you are involved in the effort, what do you care?
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnoblar
- Posts: 3
- Joined: Sat May 28, 2005 5:11 pm
- Location: Belgium
- Contact:
Wow, I started a flame war unwillinglyLordMyth wrote:May I ask why you want to go with the Haskell programming language?
I mean, it's probably faster to program your modeler in C++ or C# then converting OGRE to C (crazy idea if you ask me) and then using it in Haskell.
@LordMyth, to answer our question: just because I wanted to try how Haskell would do while
implementing a 3D modeller. I don't want to do it because I think Haskell might be better at it than C++, but to show off Haskell's strenghts. It probably won't be just another modeller like Maya or 3DS Max, but something quite different. More mathematically, probably based on L-systems and the lot.
I hope this topic can go back to helping me with finding (or creating) a C interface to Ogre3D now...
@jacmoe: If you find it interesting, do you think you know a few people who might help me with this ? I do know some C, but not enough to do it on my own. And to start with, I'd only need some basic stuff, not every feature of Ogre3D.
There are only 10 kinds of people in the world, those who know binary and those who don't
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Maybe the script-bindings for Ogre (Lua, Python, etc) could be used/modified.
They are trying to fool C-like languages to use C++ Ogre.
There could even be a SWIG for Haskell !
They are trying to fool C-like languages to use C++ Ogre.
There could even be a SWIG for Haskell !
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- haffax
- OGRE Retired Moderator
- Posts: 4823
- Joined: Fri Jun 18, 2004 1:40 pm
- Location: Berlin, Germany
- x 7
- Contact:
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
And Delphi.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnoblar
- Posts: 3
- Joined: Sat May 28, 2005 5:11 pm
- Location: Belgium
- Contact:
I can see there is some animo to set up such a thing. How hard would it be to create a basic interface in C for Ogre3D ? Just as a test case, maybe I can go on from there myself... Anyone up for that ?BenO wrote:we should port to D ^^ this would be better
There are only 10 kinds of people in the world, those who know binary and those who don't
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
It already is. It is called "Sinbad" - I kid you not.we should port to D ^^ this would be better
http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- LordMyth
- Gremlin
- Posts: 181
- Joined: Thu Jan 06, 2005 10:19 pm
- Location: Belgium
- Contact:
If you want to generate all sorts of math-based meshes and stuff, OpenGL is probably easier. But then you will have to do everything yourself and that's something you don't like, I bet. But on the other side it is very useful to know OpenGL, when looking for work there will be a big chance they never heard about OGRE...
Have a kiss from me!
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
-
- Gnoblar
- Posts: 1
- Joined: Sun Jun 05, 2005 4:08 pm
Would like something like this too
Yep, a c interface would be great.
Any ideas about how this might be done???
Any ideas about how this might be done???
- ahmedali
- Gnome
- Posts: 302
- Joined: Fri Feb 20, 2004 8:52 pm
- Location: Lahore, Pakistan
Ogre in C? I guess it will look like this, atleast it will not apear as ugly as quake's code.
uint node = createChildNode(mSceneMgr, Vector3() )
uint entity = createEntity(sceneManager, "dragon", "dragon.mesh'")
attachObject(node, entity)
traslateNode(node, Vector3)
or
nodeTraslate(node, Vector3)
May be not "uint" since ogre is managing objects.
uint node = createChildNode(mSceneMgr, Vector3() )
uint entity = createEntity(sceneManager, "dragon", "dragon.mesh'")
attachObject(node, entity)
traslateNode(node, Vector3)
or
nodeTraslate(node, Vector3)
May be not "uint" since ogre is managing objects.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
With a bit of work, you can make SWIG generate C from C++ - I found this post:
http://mailman.cs.uchicago.edu/pipermai ... 09461.html
http://mailman.cs.uchicago.edu/pipermai ... 09461.html
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnoblar
- Posts: 22
- Joined: Sun Jun 05, 2005 5:29 pm
We feel that while there is a startup cost to interfacing to non-C libraries there are substantial benifits (from both a productivity and a maintenance standpoint) to using Haskell over C++.LordMyth wrote:May I ask why you want to go with the Haskell programming language?
I mean, it's probably faster to program your modeler in C++ or C# then converting OGRE to C (crazy idea if you ask me) and then using it in Haskell.
Experience shows this to be true in other areas and I think it's true for graphics as well.
The main reason why that is, IMO, that you'd be hard pressed to find a problem domain which so neatly fits into the functional programming paradigm as graphics does.
Even the Doom 3 renderer is written in a functional style (albeit using C) internally, even though it interfaces with the rest of the engine in an OO style.
So anyway, I feel that if "someone" can get a nice interface between Haskell and some rendering system (maybe write one ourselves using the Haskell binding to OpenGL) there's a huge potential for high-level graphics programming that can surpass anything possible in conventional imperative languages such as C++ (see for instance Vertigo, an "embedded language" for shader programming in Haskell, at http://conal.net/Vertigo/).
-
- Greenskin
- Posts: 103
- Joined: Sat Jul 24, 2004 7:06 pm
I just wanted to pop in to wish you luck with the C wrapper.
I've only casually fooled around with Haskell, but it's definitely one to look out for. I'm not sure how suited it is to interactive stuff (couldn't get my head around monads and the like) but for prototyping algorithms and mathematical computation, it can't be beat! It's very slow at the moment, but being a functional language with no side effects, it also has the potential to outperform c++, since it's much easier for the compiler to parallelize code.
D is a good complement to H; it supports garbage collection, unit testing, invariates, and all the other 'big, real world project' stuff right in the language, while maintaining support for inline assembly, and all kinds of low-level hackery.
As an aside, lately I've been partial to the 'scripting' languages. Ruby, in particular, is a wonderful blend of oo, closures, serialization/marshalling, and so on. When I'm programming in c++, I'm now constantly thinking how my code could have been better if I did things "the ruby way".
Anyway, good luck!
I've only casually fooled around with Haskell, but it's definitely one to look out for. I'm not sure how suited it is to interactive stuff (couldn't get my head around monads and the like) but for prototyping algorithms and mathematical computation, it can't be beat! It's very slow at the moment, but being a functional language with no side effects, it also has the potential to outperform c++, since it's much easier for the compiler to parallelize code.
D is a good complement to H; it supports garbage collection, unit testing, invariates, and all the other 'big, real world project' stuff right in the language, while maintaining support for inline assembly, and all kinds of low-level hackery.
As an aside, lately I've been partial to the 'scripting' languages. Ruby, in particular, is a wonderful blend of oo, closures, serialization/marshalling, and so on. When I'm programming in c++, I'm now constantly thinking how my code could have been better if I did things "the ruby way".
Anyway, good luck!
-
- Gnoblar
- Posts: 22
- Joined: Sun Jun 05, 2005 5:29 pm
Another cool language is Nemerle (www.nemerle.org).
It's .Net so anything you can do in .Net (like OpenGL and DirectX) is instantly supported.
It's OOP so it's quite intuitive to use the .Net libraries
It's FP so you get the benifits of less bugs and higher productivity that FP languages offer. Specifically it offers variants (like Haskell's algebraic data types), type inference, higher order functions (yes, C# has delegates but that's clunky), local function definitions etc...
I think partial application is in the works (right now you have to use the eta long form), at least I suggested some syntax on the developer list and it seems like all of the people behind the language are for it (it's only a matter of time before they implement it).
Anyway, it's a cool language because it's basically C# with less clunky syntax, and some more powerful FP tools.
It doesn't have the purity and laziness of Haskell, sadly, but when you want to interface with .Net that's probably somewhat impossible.
It's .Net so anything you can do in .Net (like OpenGL and DirectX) is instantly supported.
It's OOP so it's quite intuitive to use the .Net libraries
It's FP so you get the benifits of less bugs and higher productivity that FP languages offer. Specifically it offers variants (like Haskell's algebraic data types), type inference, higher order functions (yes, C# has delegates but that's clunky), local function definitions etc...
I think partial application is in the works (right now you have to use the eta long form), at least I suggested some syntax on the developer list and it seems like all of the people behind the language are for it (it's only a matter of time before they implement it).
Anyway, it's a cool language because it's basically C# with less clunky syntax, and some more powerful FP tools.
It doesn't have the purity and laziness of Haskell, sadly, but when you want to interface with .Net that's probably somewhat impossible.
-
- Gnoblar
- Posts: 1
- Joined: Sun Jun 12, 2005 11:18 pm
-
- Gnoblar
- Posts: 7
- Joined: Sun Jun 12, 2005 9:15 pm