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 / 3D Physics with Box 2D

Author
Message
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 16th Mar 2013 23:28 Edited at: 16th Mar 2013 23:29
I've been playing around with combining the abilities of box2D with AGKs 3D capabilities. I figured a few people here would get a kick out of it If only we had access to 3D model coordinates

I may or may not release code later on, we'll see.

Video is attached!



swis
Joined: Tue Dec 16th 2008
Interstellar

Attachments

Login to view attachments
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 16th Mar 2013 23:29 Edited at: 16th Mar 2013 23:30
Questionably pretty picture

swis
Joined: Tue Dec 16th 2008
Interstellar

Attachments

Login to view attachments
wargasmic
18
Years of Service
User Offline
Joined: 15th Oct 2006
Location: UK
Posted: 17th Mar 2013 01:19 Edited at: 17th Mar 2013 01:21
Isn't that just 2D physics with an angled camera?

May I ask what hardware you're testing on? Sub 60fps makes me sad
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 17th Mar 2013 04:13 Edited at: 17th Mar 2013 18:00
Quote: "Isn't that just 2D physics with an angled camera?"

Well yes if you put it that way But all the pieces are 3D objects, they don't have to be entirely flat, I just made them that way for the time being. I've devised a system where all the work is done for me so I can develop 3D games played 2 dimensionally later on. (think top down)

Quote: "May I ask what hardware you're testing on? Sub 60fps makes me sad"

It's capped atm. I get about 600 fps uncapped. (and for whatever reason Fraps reduces fps from the capped value)

swis
Joined: Tue Dec 16th 2008
Interstellar
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 17th Mar 2013 06:40
Yes But it's still 2D physics with 3D objects

Baxslash already made an example with source code. You also use the technique to project 2D coordinates after physics update onto 3D objects ?
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 17th Mar 2013 17:12
Quote: "Yes But it's still 2D physics with 3D objects"

hmmm seems my title should have really been "3D: Physics with Box 2D", "3D, Physics with Box 2D", or "3D + Physics with Box 2D" (That's what I really meant with the caps on 'P')

Quote: "Baxslash already made an example with source code."

Oh really? Didn't know that I suppose I still prefer my own methods anyways haha would be good to have a look though.

Quote: "You also use the technique to project 2D coordinates after physics update onto 3D objects"

Yup! The physics realm is hidden and used to manipulate associated 3D objects.

swis
Joined: Tue Dec 16th 2008
Interstellar
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 17th Mar 2013 18:32
ok
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Mar 2013 18:38
Put a snippet at the codebase for agk
Could be usefull for someone.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 17th Mar 2013 18:44
Sounds and looks a lot like the work in progress game I posted today in Showroom

I think it's a great idea. I just think of the possibilities of making 2d games with a bit more flare as well. Think like paper mario and the like. Lighting and shaders will make those games stand out in a way normal 2d games won't

My hovercraft is full of eels
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 21st Mar 2013 19:23
Nice
Quote: "Isn't that just 2D physics with an angled camera? "

I must have missed the Angle2DCamera() command [/sarcasm]
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 23rd Mar 2013 00:16
Quote: "Put a snippet at the codebase for agk"

Will do!

Quote: "I must have missed the Angle2DCamera() command [/sarcasm]"

hehe thanks for backing me up Marl

Anyways, I'll post a full example of the project pretty soon. Just wanted to ask, has anyone else noticed the setSpritePhysicsCanRotate() command causes physics object to bounce incorrectly? I don't want to report an unconfirmed bug, but it appears to me the angles often round off and physics objects end up traveling straight up/down or left/right on bounce.

swis
Joined: Tue Dec 16th 2008
Interstellar
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 28th Mar 2013 20:51
Did a small test with box2d physics in 3d yesterday. I thought I'd share. No media needed, but obviously it looks better with textures

If anyone is interested I'll share the code, but for now here's the project.

It's controlling a character (box) with either following or FPS camera.

The following camera was quickly implemented and needs work, but hey

My hovercraft is full of eels

Attachments

Login to view attachments
spasski
AGK Backer
11
Years of Service
User Offline
Joined: 2nd Jan 2013
Location: Amsterdam
Posted: 9th Apr 2013 14:15
I'm definitely interested to see your code of doing (box)2d and 3d stuff together
lilpissywilly
AGK Developer
14
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 9th Apr 2013 23:39
Sure thing. Dropped this project to work on something similar so I don't mind posting the whole thing. It's not like it's anything special anyway, quite simple really

I think it will be self explanatory but if you have any questions you can email me.

If you want to add objects you'll see how it's done in the "loadMap()" function.

There's a texture in there too that I was using for testing, it's not made by me and cannot be used in anything commercial.

My hovercraft is full of eels

Attachments

Login to view attachments
spasski
AGK Backer
11
Years of Service
User Offline
Joined: 2nd Jan 2013
Location: Amsterdam
Posted: 9th Apr 2013 23:51
Thanks for sharing the code Lilpissywilly! I'm new into AppGameKit so sharing code is good to learn what is possible and to see how experienced users do stuff...artwork/textures I do my self
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 24th Apr 2013 03:19
Hey everybody! I know I promised code a while back and never provided any... But no fear! I'm currently developing a game around this test here so I'm refining it as I go. It may be a while before I can put any code here, but it will be highly tested by that point

swis
Joined: Tue Dec 16th 2008
Interstellar

Login to post a reply

Server time is: 2024-11-24 12:13:18
Your offset time is: 2024-11-24 12:13:18