Three.JS plugin possible?

For developers using the Construct 2 Javascript SDK

Post » Sun Mar 02, 2014 8:00 am

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:
http://carvisualizer.plus360degrees.com/threejs/
http://hellorun.helloenjoy.com/

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)
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Sun Mar 02, 2014 12:16 pm

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.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Sun Mar 02, 2014 12:46 pm

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...
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Sun Mar 02, 2014 7:58 pm

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.
B
52
S
10
G
7
Posts: 184
Reputation: 6,850

Post » Sun Mar 02, 2014 10:44 pm

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).
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Tue Mar 04, 2014 11:19 pm

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.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Thu Mar 06, 2014 6:49 pm

...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.
B
70
S
40
G
24
Posts: 518
Reputation: 20,070

Post » Thu Mar 06, 2014 10:50 pm

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.
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Mon Jan 04, 2016 11:02 pm

If you can find a Python plug-in maybe???
B
8
S
1
Posts: 2
Reputation: 425

Post » Tue Jan 05, 2016 3:03 am

@teacherpeter, is this what you are looking for?

q3d-v-2-4-3d-physics-skeletal-animation-update_t106677
B
71
S
14
G
1
Posts: 151
Reputation: 4,974

Next

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests