3D to 2D room changing [Solved]

Discussion in 'Programming' started by Cameron Clark, Oct 11, 2018.

Tags:
  1. Cameron Clark

    Cameron Clark Member

    Joined:
    Jul 19, 2018
    Posts:
    7
    I have a mainly 2D game, but I want to have singular 3D room. I can go into the 3D room with no problems. Exiting is where I'm having problems. I can't seem to get the right code for it to return to "2D mode". After the camera collides with an object, it is supposed to fade, and then set the view to orthographic, but the screen just goes black. Here's the code it triggers after it fades:
    d3d_set_projection_ortho(0, 0, room_width, room_height, 0);
    d3d_end();
    room_goto(Menu_room);
     
  2. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    5,230
    Any of the 3D features you set to true should be set to false, perhaps. So if you enabled fog, disable it before going back to the menu. Just go through each feature one at a time to narrow down which is the culprit.
     
  3. flyingsaucerinvasion

    flyingsaucerinvasion Member

    Joined:
    Jun 20, 2016
    Posts:
    1,706
    you say it is supposed to fade.... is it actually a problem with that mechanism?
     
  4. Cameron Clark

    Cameron Clark Member

    Joined:
    Jul 19, 2018
    Posts:
    7
    No, it fades just fine, but when I try to go back to a "2D room" It just displays black. I've tried turning d3d_set_lighting(false), but that didn't help either. I'm going to try disabling things I didn't enable the first place just to be sure next.
     
  5. Cameron Clark

    Cameron Clark Member

    Joined:
    Jul 19, 2018
    Posts:
    7
    So it is going to the 2D room, I just can't see anything. The only think I can think of is the depth of the camera, but I don't think that's right:mad:
     
  6. Misty

    Misty Member

    Joined:
    Jun 22, 2016
    Posts:
    826
    I remember in GM8, or GM6, disabling 3d did nothing and you could never go back to 2d mode. I dont know if its the same in gm studio or not.
     
  7. Cameron Clark

    Cameron Clark Member

    Joined:
    Jul 19, 2018
    Posts:
    7
    So just for anyone who wants to know, I FINALLY figured it out. For some reason the fade was messing up the d3d_end() code. When I got rid of the fade it worked just fine.
     
  8. flyingsaucerinvasion

    flyingsaucerinvasion Member

    Joined:
    Jun 20, 2016
    Posts:
    1,706
    you're probably just making some kind of logical error with your fade... I doubt it is somehow messing up d3d_end. By the way, you don't even need d3d_end if you set an ortho projection. You might need to turn off ztesting and backface culling, also maybe lighting and fog.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice