Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Mapping 2D physics to 3D objects

Author
Message
_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 3rd Aug 2014 20:29
Hi,

how do I map 2D physics to 3D objects?
I'm sure somebody has done this for some kind of 2.5D game. I want to run a Box2D simulation and apply the positions and rotations of objects (invisible dummy sprites) to 3D objects for the visual output. But somehow I can't really get it to line up perfectly.

I've searched around here but couldn't find the answer. I've read that there is somekind of snippet by baxslash that does something similar, but I couldn't find it.

Any help or hints are greatly appreciated!

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 3rd Aug 2014 21:04
Yeah, the only one I remember was the one from Bax.

Wasn't it published in one of the newsletters?
_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 3rd Aug 2014 21:08
Yeah, I just found the snippet in the ADG Newsletter 12. I'm checking that out now...

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 3rd Aug 2014 21:29
Give a shout if you still need an example of this, I've posted a few.

My hovercraft is full of eels
_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 5th Aug 2014 08:56 Edited at: 5th Aug 2014 08:57
Ok,
here's an important reminder: Keep an eye on your sprite offsets while transforming 2D to 3D, especially when working with polygonal collision shapes!

Many of my coordinates got messed up because of this and it wasn't until I set all sprite offsets to 0, 0 that the two worlds lined up perfectly.
I lost quite a bit of nerves about this since I got the simple principles working in the first place but couldn't see where the offsets were coming from.

Play Super Footie Online: SuperFootie.com

Development News: Forum Thread
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th Aug 2014 17:29
I wrote a bunch of functions that managed 2D physics for 3D objects automatically and built a game around it, but people didn't seem very interested. Make sure to watch out where you update the coordinates. You should be splitting up the sync() command

Login to post a reply

Server time is: 2024-05-13 10:20:13
Your offset time is: 2024-05-13 10:20:13