Implementing Box2D into isometric question.

Started by
4 comments, last by yps_sps 7 years, 6 months ago

Does anyone know how well Box2D works in Isometric? And if it works out pretty well, could I get some tips on implementing it?

Some notes about the world...

The world is just going to be 2D sprites, and there will only be one plain of movement. That is to say that there will be no bridges that goes over a walkable path.

Advertisement

It doesn't matter from what angle you're viewing the 2D plane on which the physics interactions happen.

http://rengelbert.com/blog/basic-collision-for-3d-box2d/

RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.

I guess where I am hunged up the most is trying to convert box2D's coordinates to isometric projection.

Because while box will see it as top down, I still need to convert information between spaces.

Like using the Open Source software tiled. When you draw polygons in isometric, you need to convert the polygons to orthogonal projection. And then scale them to your physics world scale.

Good point of Box2D being that, akin to how logical maps work (independent to real screen coordinates), is not tied to the actual graphical representation

@Tangletail; as in, converting world space coordinates to view space?

I will grant that the Articles system is not as good as it used to be on this site, but there are a crapton of articles about all manners of 2D graphics topics still on this site. Try this one.

http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/axonometric-projections-a-technical-overview-r3223

RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.

Basically it's just the axis aligned tilemap but rendered in isometric view.

Rendering a 2D tilemap into isometric projection in 2D would just work like this


x = (tile.x - tile.y) * (TILE_WIDTH / 2)
y = (tile.y + tile.x) * (TILE_HEIGHT / 2)

Assuming it's a 2:1 ratio isometric projection. Checking collision would basically just be the opposite of that with some algebra

"Two plus two equals five ... for extremely large values of two."

This topic is closed to new replies.

Advertisement