pouët.net

three.js but for c/c++?

category: code [glöplog]
Does anything like this exist? Not necessarily the exact same API, but something that offers similar functionality (scene graph, basic geometry, modern opengl).

Ive found a couple projects (literally three.js to c++ implementation attempts) on github but they seem dead.
added on the 2015-04-19 01:22:32 by mkm mkm
Try OpenFrameworks. I never did, but I've seen people using it and happy about it.
added on the 2015-04-19 01:40:40 by tomkh tomkh
Theres this, but without knowing what three.js does I might be a little off target?

http://oglplus.org/


If I werent rolling my own, I'd probably start there.
added on the 2015-04-19 09:53:39 by Canopy Canopy
I haven't tried it myself but I've been told http://libcinder.org/ is good.
added on the 2015-04-19 09:56:06 by Gargaj Gargaj
only complain I have with libcinder is that it's slow to compile. Otherwise it's full featured
added on the 2015-04-19 10:22:14 by _-_-__ _-_-__
Cinder(+1, looks good), OpenFrameworks(-1, limited & convoluted), SFML (more like SDL on steroids, but might be worth a try).
added on the 2015-04-19 11:09:35 by tomaes tomaes
i have used both libcinder and OF, i prefer libcinder.
both are overkill on dependencies if you just want to do a simple demo though.
in 2015 i think you're better off using unity3d though, but that's just my opinion.
added on the 2015-04-19 12:56:38 by psenough psenough
Depending on what exactly you're looking for these might also be of interest:

http://g3d.sourceforge.net/
http://www.geometrictools.com/
http://www.openframeworks.cc/
http://www.visualizationlibrary.org/
added on the 2015-04-20 09:35:58 by eyebex eyebex
looked at both libcinder and openframeworks, both seem a little heavy handed, and unity is definitely heavyhanded.

libcinder modern opengl (core profile) seems like work in progress (theres a nextgl dev branch), and im not sure whats going on with openframeworks, looks like modern opengl support exists, but apparently I'm still supposed to push/pop matrices?. both come with a ton of lib baggage to the point that project generators are necessary. definitely great alternatives to processing tho.

considering (and leaning towards) rolling my own using glm as a crutch.
added on the 2015-04-20 09:57:13 by mkm mkm
also i probably should have clarified what i was after, more or less a thin layer over opengl, fbo, vbo, vao, shader management stuffed into a scene graph.

similar to how threejs wraps webgl, seems to hit a sweet spot without going overboard (to be honest ive never touched js so my obvservation could be off)
added on the 2015-04-20 10:05:23 by mkm mkm
mkm: you didn't comment on the opengl+ thing i posted?

To me it sounds like the closest to what you're asking for.

I did roll my own (only what I need to use) but in straight C using structs to give some OO. I'm now in the process of refactoring/moving it all to C++. Including rolling my own versions of the stuff GLM could provide.

tbh. the glm stuff is less of a hassle than the rest. Juggling things like vao/vbo and which shader + where its attributes/uniforms are (I call this a model) are associated with the buffers forces you to think in an object oriented, scene graph-ish manner as you have to tie which 'model' gets drawn using which shader. things like instancing or doing render to texture are things libraries may not expose in their "scene graphs" but that you can choose to implement in your own thing.

Yes it is much slower going timewise, but much more satisfying. I'm doing this to learn not 'just' "make a demo (tm)". Whats really good IMO is that I know how things I use work and have a deeper level of understanding of everything I use than I'd ever get using via a library. Plus I have unified object management throughout the entire project as unified debug output/logging which I've made a lot of effort to put good quality logging in.

In short. if it goes wrong, its my fault, but I will an idea on how to fix it. Doing some new apps will take time especially if the base code doesn't support it. but everything that does exist has been used as I only add what I need, and in the refactor have designed single scene test apps for features I definitely have used regularly, to get me back where I was.
added on the 2015-04-20 13:16:02 by Canopy Canopy
well, if you want a three.js equivalent in c++ then libcinder is the way to go. still, for a fast demo, it's better to use unity though.
added on the 2015-04-20 14:56:20 by Defiance Defiance
or minko, if you wanna be cross platform
added on the 2015-04-20 16:01:37 by maali maali
Unreal Engine
added on the 2015-04-20 17:16:24 by Harekiet Harekiet
Really, if "three.js" exists for C++?

I'm not sure if I fucking wanna answer that question.
added on the 2015-04-21 22:05:02 by superplek superplek
plek: newsflash, javascript is more popular as a learning programming language then c++. the horror!
added on the 2015-04-21 23:41:03 by psenough psenough
get the fuck outta my hair and see the fair point that stuff like thee.js is a fucking derivative
added on the 2015-04-22 01:37:02 by superplek superplek
Canopy: have you released your framework, by any chance? ;) Made any demos with it? Looking forward to seeing awesome stuff!
added on the 2016-01-26 03:04:25 by cxw cxw
OpenFrameworks and SFML both work well, but I'd use SFML in the future because I think it was a bit easier to get going.
added on the 2016-01-26 05:15:21 by visy visy
Thanks for the tip!
added on the 2016-01-26 12:11:06 by cxw cxw
With GL 4.5 it's quite easy to roll your own.
added on the 2016-01-26 12:33:33 by EvilOne EvilOne
Quote:
Canopy: have you released your framework, by any chance? ;) Made any demos with it? Looking forward to seeing awesome stuff!


Sorry never noticed this! No, and doubtful I ever will. Its a very lean implementation as I'm only supporting things on a 'need' basis. I'm making a framework for my own re-use for projects I have in mind, not as a fully functioning thing. Does that makes sense? (don't make engines, make demos!) So, I'm not making an fully fledged engine, just a small light, re-useable thing for the things I need.

I've made some good progress, and my plan is still solid. My enemy is time, and one other project - I have to get out of the way (as its costing me money each month I don't do it!) once that's done i'll be back on it :)
added on the 2016-01-26 12:59:07 by Canopy Canopy
Canopy: BB Image Good luck!
added on the 2016-01-26 23:56:34 by cxw cxw
I am working in Unity5 on a professional project to be released pretty soon and let me say this:
Don´t use Unity5 for Demos...almost every component is buggy by now! Especially Physics! We had to hack around those stupid bugs most of the development-time. Also Unity is a black box, you can´t see or even better alter any code of the engine...which should be possible in Unreal4 afaik. Also Unreal is C++, which is way faster than C# or Java.
I think Unity4.6 is still usable, but has some buggy components aswell!

TL;DR:
USE Unreal4;
DONT USE Unity5;
If you really need Unity because of Java, go for Unity4.6 !
As if physics were ever not buggy in demos. ;)

Quote:
Also Unreal is C++, which is way faster than C# or Java.

Hey look, it's the early 2000s all over again!

login