Pages: 1
  Print  
Author Topic: 2D on 3D, vice versa?  (Read 2001 times)
Offline (Male) ZackCDLVI
Posted on: October 01, 2014, 03:13:16 PM

Member
Joined: Sep 2014
Posts: 5

View Profile
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.
« Last Edit: October 01, 2014, 03:55:44 PM by ZackCDLVI » Logged
Stay frosty, Zack
Offline (Male) DaSpirit
Reply #1 Posted on: October 01, 2014, 03:53:41 PM

Member
Location: New York City
Joined: Mar 2013
Posts: 124

View Profile
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!).
« Last Edit: October 01, 2014, 03:56:00 PM by DaSpirit » Logged
Offline (Male) ZackCDLVI
Reply #2 Posted on: October 01, 2014, 04:03:20 PM

Member
Joined: Sep 2014
Posts: 5

View Profile
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.
Logged
Stay frosty, Zack
Offline (Male) time-killer-games
Reply #3 Posted on: October 01, 2014, 04:50:36 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1166

View Profile Email
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/
Logged
Offline (Male) Goombert
Reply #4 Posted on: October 01, 2014, 06:08:16 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
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?
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) time-killer-games
Reply #5 Posted on: October 01, 2014, 06:50:34 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1166

View Profile Email
^same.
Logged
Offline (Unknown gender) Ideka
Reply #6 Posted on: October 08, 2014, 01:02:14 PM

Member
Joined: Apr 2011
Posts: 85

View Profile
I have to say, that looks beautiful, DaSpirit.
Logged
Pages: 1
  Print