Pages: 1
Author Topic: 2D on 3D, vice versa?  (33,074 Views)
Offline (Unknown gender) ZackCDLVI
Guest


Email
Posted on: October 01, 2014, 08:13:16 PM
Just a breif introduction.  :eng101: I'm a former Game Maker user who stopped using the software after I moved to PowerPC Mac Mini the same week my Windows PC decided to die, back in 2005. Fast forward to 2007, I was PC jumping between a tower I got when my Mini died, and early 2000s laptop, but was able to experiment with Game Maker for that time. Fast forward to 2010 and I finally got a modern laptop and on Linux where I discovered Eigma/LateralGM. So, I'm rusty, and only familar with Game Maker up 6. Now, to the real subject:

Now, I have no idea where to put this. But, my question is, how would you make a game that combined 2D sprites in an 3D enviroment in GML in an isometric persective? And, maybe the other way around too.
Offline (Unknown gender) DaSpirit

Member
Joined: Apr 2013
Posts: 124
View profile
Reply #1 Posted on: October 01, 2014, 08:53:41 PM
Welcome to the forums and I hope you're liking ENIGMA!

I've done this before! :p


You're referring to a technique called 3d billboarding. How this works is that you render a single quad and you simply rotate it towards the camera. I just stored the values I used in d3d_set_projection() and use them to rotate my quad.

There are a few problems to this technique, namely one that I never solved correctly (because GM was incapable of solving efficiently at the time), and it has to do with depths. Consider my screen above and imagine that the player moves up in front of the tree. Their head will go inside the tree (because he is actually being rotated). The way I solved this is by manually calculating the depths based on position and disabling depth testing using d3d_set_hidden(false). It works fine, as long as the camera isn't allowed to be rotated arbitrarily (otherwise, you'd have to recalculate new depths per-step). If you do have to rotate your camera artibrarily, then you could possibly use a shader instead of recalculating it (which ENIGMA thankfully has!).
Offline (Unknown gender) ZackCDLVI
Guest


Email
Reply #2 Posted on: October 01, 2014, 09:03:20 PM
Thank you! And I'm really enjoying it. Is there a way you (or anyone else) can provide a source example of that, or similar? I'm working on a game that will most likely use 3D billboarding since I'm better at 3D objects in Blender then I am with people.
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #3 Posted on: October 01, 2014, 09:50:36 PM
This should help you.
http://enigma-dev.org/edc/games.php?game=43

And.
http://enigma-dev.org/edc/games.php?game=51

if those examples don't work report any issues you might have.
http://enigma-dev.org/tracker/
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #4 Posted on: October 01, 2014, 11:08:16 PM
DaSpirit, is that the Pokemon game you were supposedly working on before? If so that looks damn amazing, why the hell are you not still working on it?
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #5 Posted on: October 01, 2014, 11:50:34 PM
^same.
Offline (Unknown gender) Ideka

Member
Joined: Apr 2011
Posts: 85
View profile
Reply #6 Posted on: October 08, 2014, 06:02:14 PM
I have to say, that looks beautiful, DaSpirit.
Pages: 1