How do I get this example to work in C3?

0 favourites
From the Asset Store
Unlock platyers earning coins, and save it with Localstorage
  • tunepunk

    I agree it would be more user friendly like that. It's just not a priority atm.

    Nepeo

    Glad you thought it interesting to port over.

    Jquery was just an easy way to get the js file loading with one line from the eventsheet in C2. So I kind of like it in that context. Project file loading works fine here, so I guess that's a C3 thing. I'm only concerned with web export though.

    It's probably the least hacky way to do 3d in C2 I've found so far. While it does use the same gl context to do the rendering, the only hacky thing is it takes over some object's drawgl as a entry point. Nothing really specific to Construct's renderer other than telling it to finish what it's doing with glw.endbatch(). The Fbo was only added to work around the gl context being created without a depth buffer.

    I don't mind brittle. Using js directly makes it very brittle with typos and stuff. Also the internal apis used are mostly documented in the sdk, but besides that it's not like C2's internals will change at this point, I'm not even using the latest release.

    All a plugin would add for me is making this work when using export with minifying. Otherwise it just makes developing more time consuming and tedious for me. Personal preference, really. I'm not really interested in making a plugin anyway. This is basically just me getting more fluent in webgl, and integrating it into C2 in some way.

  • I linked this thread on the idea request page.

    construct3.ideas.aha.io/ideas/C3-I-55

    If it's not too much work turning something like this in to a working 3D sprite plugin, it would be a welcome cool addition to C3's capabilities while still being a 2D game engine.

    As described previously it's just tedious and memory hogging to pre render sprites many many frames just for smooth rotations of objects.

    If anyone else supports this kind of 3D sprite concept...

    go to link above and upvote and comment.

    A big thanks to Nepeo R0J0hound for making these examples. They are really fun to play around with.

  • Rotating 3D sprites is actually a huge amount of work. As soon as 3D objects can intersect, you need a depth buffer to render it correctly. Depth buffers don't work with transparency, which is a pretty critical point for a 2D engine. There are ways to solve that, but if you do that and also allow rotating the camera too, by the time you've finished solving all the follow-on problems you've essentially created a full-blown 3D engine. That's something we consciously want to avoid right now.

  • * No camera angles. Only option would be Orthographic and perspective with the same FOV as the new Z elevation.

    * No intersection needed, it's better to limit the plugin to one 3D file + texture per "3D sprite" object. Usage would be mainly as the gifs i've posted in this thread.. Very very simple objects. They act and behave like a sprite but can be rotated in all diretions that's it.

    * Transparency not really needed.

    * Shaders not needed. Surface shading model with any lights/shadows baked in texture.

    * Lights not need because of surface shading.

    * No bump maps, no specularity... just 1 - 3d mesh + texture per object.

  • * No intersection needed, it's better to limit the plugin to one 3D file + texture per "3D sprite" object. Usage would be mainly as the gifs i've posted in this thread.. Very very simple objects. They act and behave like a sprite but can be rotated in all diretions that's it.

    I think intersection is the wrong term - true 3D always needs a depth buffer because it needs order-independent overlap. For example two 3D cubes next to each other cannot simply be rendered one after the other like everything currently is - you need a depth buffer to resolve the overlap in perspective.

    * Transparency not really needed.

    Your own rotating coin and playing card examples use transparency! Besides, in my long experience, anything along the lines of "that's not really needed" turns out to actually be needed (perhaps by other users than yourself), who go and file bugs saying that it doesn't work right and asking us to fix it.

  • R0J0hound Thanks for this cool demo!

    Just to do some learning, I tried porting it to the c3 runtime (the previous *.c3p only worked in the c2 runtime for me.) I got the demo semi-working with the c3 runtime. The main 3d objects render, but there are still some webgl errors reported on the console, and other 2d sprites are not rendered, so it's not complete.

    I had to:

    - Update some C3 SDK calls and change some functions to async (in JS and execJS events)

    - For example: image.src = await window.myBigB._assetManager.LoadProjectFileUrl(url);

    - Use new pointers for object draw function and glwrap (SDK changes)

    - Update some of the mat4.* calls to the later mat4.* api

    If you want to play with the c3runtime version (and try to fix it, so there are no errors and other elements are rendered!) check it out here:

    sendgb.com/Pqdzn3raMFH

    FYI here's the error I see:

    GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 0

  • Hi, I'm not sure I understand everything, I'd like to ask something.

    Can this be used in C3 ?.

    I would use it for C2 but I would like to know if it can be used in C3 for a possible future adaptation of my project.

  • Mikal Maybe Nepeo Can help make the example work with C3 runtime as well. He was the one Solving so it can be opened and run in C3 (but with C2 runtime)

    That would be great if he or anyone else with the knowhow could help make it run in the C3 runtime as well. I think Rojo don't really use C3. It's a really cool example and very nice to use in some cases for a 3D effect.

    The early example in the thread can be run in C2 and C3 using the C2 runtime. If you're going to use it i would suggest sticking to either the C3 or the C2 version.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the info.

    I would use it for a future project with a superior perspective, to make the buildings semi 3D.

    The walls of the buildings would draw with this plugin, I would have to do tests of course but I do not think there are performance problems, my game is low resolution 320x240.

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