Three.JS plugin possible?

0 favourites
  • 11 posts
From the Asset Store
[C2] [C3] support C3 build service | support Banner ads, Interstitial ads, Rewared video ads.
  • Hello everyone! I'm just curious about one thing in particular:

    There is an awesome JS framework called Three.JS which can use JavaScript and HTML5 to render very impressive 3D graphics (by simplifying WebGL commands, from what I understand).

    See an example of the kind of 3D graphics that are possible here:

    So, I know that C2 is currently a dedicated 2D engine, but I'm just curious how possible it might be to create something like a Three.JS plugin. I'm not requesting that someone do it for me and help me do it. I'm just curious if it's possible. I'm learning JavaScript now and after a year or so when I'm a bit more fluent I might take on the task.

    What say you, gentlemen? (and possibly ladies)

  • It's possible, but the rest of the C2 editor is geared towards 2D games, so it would be difficult to use in practice even if a complete plugin was produced.

  • Right, that makes sense. I'm just getting started with the idea of plugins so the scope of everything hasn't really hit me yet. I imagine it probably could be done but the plugin itself would have to be tremendous. It might be best if the 3D elements were treated as 2D (e.g. a 2D sidescroller with 3D graphics). Even that would require an insane amount of work to get animations working, not to mention collisions...

  • As far as collisions go, it seems like unless you needed ultra fine collision detection, something like a cube, sphere, or capsule shaped collision area would work; and since (as you said) you'd probably make something that gets treated as 2D, you could probably knock a dimension off that and be left with something much more manageable given everything else.

  • Yeah, I suppose so, but those animations would be difficult to figure out. I guess I'd have to look into how Three.JS handles it (if it does at all).

  • The question shouldn't be can threejs be used in C2, but instead could C2 be used to create 3D games.

    Let's tackle the second question first as it's already been commented on.

    "could C2 be used to create 3D games"

    The answer is yes. In fact some one already did this with Copperlicht engine. It's not a monumental feet not insanely difficult. However doing so would pretty much make everything else useless. You can't use Sprites and all sorts of yummy objects. Why becase they would be rendered under or over the 3d rendered world. There is no integration of objects. So such other objects would be limited to that of the UI.

    If your doing this model then the collision detection would be based on what 3js already provide and so no need to create any aditional work.

    Let's tackle the first question second because it's the better way of using any 3d api.

    "can threejs be used in C2"

    The answer is YES and without much difficulty, but doing so will require re-thinking and working around the situation. Instead of 3D worlds, think of instead 3D objects. ThreeJS supports texture based rendering. This enables the dev to render an object/group to JS Image. This image then can be used as a sprite render replacement.

    If you go with this design. Then your using C2 collision detection and no need for additional work.

    The answer is overall. yes to both, but it's only really worth the effort to create as an object rather than a 3D world. It's not difficult just time consuming for the effort and research. I however may be looking into this myself shortly. I also did the research ahead of time to know this stuff.

    Now however if you want to actually do C2 as a 3D game engine. That is still doable. However this would indeed required making many new Plugins as replacement's to C2 already fantastic Plugins. All Behaviours relating to position would be need to be made to have 3D replacements. Then you would need an object in the IDE to act as camera control. It's doable, but would take time.Probably a few months.

  • ...pretty sure it's already been made clear C2 is officially 2D for the forseeable future. It's not like there aren't already 3D game development tools out there better suited to that task than trying to shoehorn it into a program geared towards 2D.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You're right, of course, but I wasn't trying to make 3D game. Rather I was exploring the possibilities of JavaScript plugins and entertaining the notion of 3D objects behaving as 2D, which could add a nice effect to some projects.

  • If you can find a Python plug-in maybe???

  • teacherpeter, is this what you are looking for?

  • If construct2's editor was open source, then the developer of q3d threejs or any other 3d implementation would be able to add the needed features for 3d game design.

    But constrcut2 editor's sdk is not open source. So while developers can add new behaviours via plugins, they cant really do anything to the editor's interface or features.

    If you wanr 3d+html5, check out Superpowers!

    It was just open sourced:

    It uses threejs, but it can use any other engine. Recently they added support for LOVE (lua) as well.

    If I was Ashley, I would just take superpowers and use it as an editor - just add construct2's core to it. I think their MIT license would allow it too <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing">

    Superpowers has the features to support both 2d and 3d games. Here is their github:

    [quote:2ayl5457]But the coolest thing is this: Superpowers itself is actually engine-agnostic. It's just a piece of software for collaborating on projects and you can extend it with project types and editors.

    Have fun

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)