Codes for First Person Cam?

Discussion in 'Programming' started by Madeon Unity, Jul 20, 2017.

  1. Madeon Unity

    Madeon Unity Member

    Joined:
    Jun 11, 2017
    Posts:
    21
    Please help :( i am trying to make a maze game in first person but i don't know how..
     
  2. Edmanbosch

    Edmanbosch Member

    Joined:
    Jan 6, 2017
    Posts:
    180
    3D in GM is not that complete and is pretty complicated to setup. It's really only good if you're just really curious, or you want to see what you can do with it, and not a full game.
     
  3. BattleRifle BR55

    BattleRifle BR55 Member

    Joined:
    Jun 24, 2016
    Posts:
    947
    Are you working in GM:S 1 or 2?

    I beg to differ.
     
    xygthop3 and Lonewolff like this.
  4. Edmanbosch

    Edmanbosch Member

    Joined:
    Jan 6, 2017
    Posts:
    180
    What do you mean?
     
  5. Binsk

    Binsk Member

    Joined:
    Jun 22, 2016
    Posts:
    542
    What have you tried so far, Madeon? Your question is a bit vague, do you have something more specific we can help you with?

    If you just don't know where to start then you should probably look up some tutorials.
     
  6. Madeon Unity

    Madeon Unity Member

    Joined:
    Jun 11, 2017
    Posts:
    21
    I'm using GM:S 1..
     
  7. Madeon Unity

    Madeon Unity Member

    Joined:
    Jun 11, 2017
    Posts:
    21
    I haven't touch anything yet.. Even doing the 3Ds? I can't.. .
     
  8. Binsk

    Binsk Member

    Joined:
    Jun 22, 2016
    Posts:
    542
    Ah, then you won't be able to make a 3D game. You'll just keep having to ask people for code drops at that rate.

    Start small, simple, and in 2D. Look up some tutorials and follow them through until you feel comfortable with GameMaker.

    It's important to learn trouble shooting and thinking outside the box when it comes to game development. You can only get this through practice.

    Pair this with an understanding of GameMaker's programming syntax and building something can be easy with a little research. And math. Lots of math.

    Just doing a first person camera as you are asking requires knowledge of 3d vectors and trigonometry. These are the kinds of things you will be dealing with.
     
    Edmanbosch and Madeon Unity like this.
  9. Madeon Unity

    Madeon Unity Member

    Joined:
    Jun 11, 2017
    Posts:
    21
    Ah.. Bugs are normal.. Ok. But I do know how to make 2D games.. So far. I think.
     
  10. Not Alan

    Not Alan Member

    Joined:
    Sunday
    Posts:
    1
    Don't listen to those who say 3d with gamemaker is hard and you shouldn't go for it. I found the tutorials by Tristan Batchler very helpful when I wanted to learn how to work with 3d. It is not as hard as people make it seem. With tutorials like that and the gamemaker guide, you can become pretty good at it.
     
    Lonewolff likes this.
  11. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,088
    I second that.
     
  12. flyingsaucerinvasion

    flyingsaucerinvasion Member

    Joined:
    Jun 20, 2016
    Posts:
    2,046
    The first thing to do is to learn how to set your view and projection. In gms1, that can be done with the d3d_set_projection_ext() function. The first 3 arguments, are the position of the camera, the second three are the point that the camera is looking at, the third three are the up vector (must not be parallel to direction camera is looking). The rest of the arguments are (vertical) field of view, aspect ratio (width/height of view port), and then the near and far clipping distances (nothing nearer to the camera along the view's z axis than the near clipping distance will be drawn, nothing farther along the view's z axis than the far clipping distance will be drawn). The view's z axis points in the direction that the camera is looking.

    In fact, you don't even need to use the built-in functions to create view or projection matrices. They are actually stored in gml as 16 element arrays, so you can build those matrices manually in gml. Learning how those matrices are constructed (and why) is a very good learning experience for anybody planning to work with 3d.

    Actually, no. The first thing you need to do is learn about coordinate systems. When you use a perspective projection in gms1, using built-in functions, then you will be in a left-handed coordinate system. The handedness of the coordinate system defines the spacial relationship between the x, y, and z axes. To determine which coordinate system you are in, point your index finger in the +x direction (in world space), your middle finger in the +y direction, and your thumb in the +z direction. If you can do that with your left hand, then you are in a left-handed coordinate system. If you can do that with your right hand, then you are in a right-handed coordinate system. Example of doing this with a right-handed coordinate system: http://www.csharphelper.com/understanding_wpf_3d_2.png

    The coordinate system is determined by the view and projection matrices, as well as your display (but the display is basically a constant, i.e., won't change). Note that while the built-in perspective projection functions will create a left-handed coordinate system, the built-in orthographic projection functions (including gamemaker's default 2d views), all use a right-handed coordinate system. This means going from orthographic (or 2d) to perspective will result in a change from right-handed to left-handed coordinate systems. The consequence of this is that everything will appeared mirrored: geometry, rotation angles, textures. Also far-side culling will be reversed. A change in coordinate system does not affect the logic of the game however, except if you need to distinguish between left and right.
     
    Last edited: Jul 14, 2019 at 7:34 PM

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