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 / Mixing 2d and 3d

Author
Message
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 22nd Oct 2012 20:55
Hi all,
I'm trying to mix 2d and 3d in the same game but all I get are 2d sprites drawn over 3d objets.
i'd like to know if is possible "insert" 3d objects between two 2d graphics with different depth (using the spritedepth() command).
I know I can emulate the effect using little 3d planes to simulate sprites but I'd like use the benefits of 2d sprites and the 3d objects at same time. Is it possible?
Thanks in advance =)
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd Oct 2012 21:02
In the next version there will be a new command Set3DGlobalDepth( int ) which will set the sprite depth that all 3D objects should be drawn at. Sprites with a depth greater than this will be drawn behind and sprites with a depth less than this will be drawn in front.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 22nd Oct 2012 23:35
I have a question perhaps on the same theme of 2d and 3d. Is there anyway to make box2d work with 3d plains? Or will there be a separate physics system for 3d?

My hovercraft is full of eels
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Oct 2012 01:09
Box2D will not interact with 3D objects. There will eventually be a 3D physics system for 3D objects.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 23rd Oct 2012 01:28
Quote: "Box2D will not interact with 3D objects. There will eventually be a 3D physics system for 3D objects."

Funny you should say that, I just made a demo of just that for the next ADG newsletter

I'll attach a version here so you can have a look. There will be an article to go with it, if you want to register on baxspace.com you'll get the newsletter in about 3 days time.


this.mess = abs(sin(times#))

Attachments

Login to view attachments
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Oct 2012 02:29
Clever, as long as everything remains on a 2D ground it can indeed be simulated by Box2D
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 23rd Oct 2012 05:23
You could easily enough do a side scroller like that as well
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 23rd Oct 2012 07:07
Quote: "In the next version there will be a new command Set3DGlobalDepth( int ) which will set the sprite depth that all 3D objects should be drawn at. Sprites with a depth greater than this will be drawn behind and sprites with a depth less than this will be drawn in front."


Great, Paul!
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 23rd Oct 2012 10:52
That's brilliant bax!

Thanks for the answer Paul

My hovercraft is full of eels
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 23rd Oct 2012 16:12
Wow great demo Bax.
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 23rd Oct 2012 21:21
Good work, Bax.

Login to post a reply

Server time is: 2024-05-04 09:55:07
Your offset time is: 2024-05-04 09:55:07