Render 2d world and one 3d model

Hello, I could not find an answer to his two questions:

  1. I use a 3D object in your 2D game can? I want to make 3D and the ball a little bit I managed it, thanks - http://www.defold.com/manuals/model/ and found on the forum example. But when creating 2D land, as in the examples used “Platformer” I do not see it. How do I display and 2D and 3D model of the earth?
  2. I can do so that would be my 3d ball interacted with the land? I jump on the ground, bouncing from her?

We have support for both 2D and 3D physics so you should be able to get a bouncing ball working in a 3D environment and it should be possible to mix 2D and 3D. Maybe @sven has an example?

I’m not fully sure what you want to accomplish. :frowning: Do you want to have 3D visuals (like 3D models/meshes) but in a 2D physics world? A typical example is creating “2.5D” games, like Worms Revolution.

In that case I would suggest you “render” everything, including sprites, with the same material (or more precisely, same predicate tag and same 3D camera). It can be quite tricky to get right, but it should be possible. :slight_smile: First thing to verify is to make sure your sprites, tilemaps etc have the the same material tags as your 3D model material and that everything is rendered using the same camera in your render_script.

Sadly I don’t have a good example for this currently, but it sounds like a fun project to try sometime in the future!

Sometimes you want 2D physics, but to also be able to use raycasting for mixed elements, which is 3D only.

1 Like