Babylon 3D Model to sprite experiment

0 favourites
  • 10 posts
From the Asset Store
Create your game with this complete pack of images and animations!
  • I am experimenting with a simple Babylon C3 addon. It renders a number of Babylon animated 3D models in a single canvas and then you can use the models as 2D Sprites in C3. You can zoom in and out of individual models and control the camera and animation for each model. It could be useful for a game like Donkey Kong Country w/ 3D model for the character in 2d platformer world. You can apply effects, z order, layer, rotate etc. similar to a sprite.

    Here's a couple examples:

    Single 3D model, attached to a sprite w/ platformer behavior:

    31 model (each rendered separately w/ separate camera control):

  • Hey, Mikal, looks very cool!

    In what format is the 3D model loaded in C3? Will there be an example from you in c3p and what other plans for this addon?

  • Thanks!

    The format _should_ be whatever Babylon accepts (gtlf, glb, babylon, obj), but I had to hardwire it for glb for C3 preview mode (since Babylon normally uses file extensions to check format, but in C3 preview mode, the file extensions are obscured due to referencing preview blob urls.)

    The conversion to glb does not seem too bad (there are converters out there.) The one pain I have run into is converting fbx models w/ separate fbx animations to glb. I had to load them into blender, combine them together and then export to glb.

    These are early days for the plugin experiment. In general it's similar to the released C3 Spine plugin that I have been working on, mainly for render/image, but all physics, game logic, behavior would be done in C3 with another sprite that the Babylon Model is 'pinned' to.

    What 3D model formats are you interested in using?

  • I use blender, so I won't have any problems with the glb format.

    I have another question: to use multiple model animations, do I have to use multiple glb files? Can't use 1 file, such as in the spine plugin, which would contain several animations and then change them?

    I would like to see what it looks like in C3

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The glb format supports multiple animations in one file and I have a simple play animation Action that controls which animation plays and switching animations. There is no 'tweening' between animations yet, but that's a natural next step.

    If you want to see Babylon render similar to this addon, load a glb into this online Babylon viewer (allows for selecting of animations also.)

    sandbox.babylonjs.com

    Connect with me on the Construct Community Discord or Twitter (@kindeyegames), if you have models to test. It's still in the experimental stage, but it's interesting to play with.

    Another example with simple light control.

  • I tried to upload my old 3D model, but for some reason its texture is not displayed. (so I don't have any normal models to test yet) I took 2 free glb models and one of them was also displayed without a texture. But the second model was fine. Don't know why the glb file might not display the texture? Incorrect export?

    the plugin is very widely used. Especially if you can implement 'tweening' between animations and have stable performance

  • I have seen converters/exporters sometimes fail to work perfectly between formats (and also have read about folks having troubles in general between many formats), in particular textures (there seem to be multiple different ways to handle 'materials' beyond just diffuse color between formats and tools.)

    If a glb works in the sandbox, it will very likely work using this plugin (since it's all based on Babylon and Babylon gtlf/glb loader.)

    In general performance could be relatively stable on desktop, but mobile tends to not handle dynamic texture updates from a canvas very well.

  • Some more work on Babylon 3D Model Sprite plugin, added default Animation Blending and isPlaying, onAnimimationFinished ACEs to handle transitions. Contact me on Construct Community Discord if you want to Alpha test (and have a 3D model to test with).

  • Hello Mikal,

    Any news of your Babylon addon ?

  • I moved on from this experiment, focusing on my 3D Object plug-in instead, since it’s better integrated with C3 (however does not have animation/lighting like Babylon).

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