GMS 2 EZ3DCam - A fully featured, easy to use, and FREE 3D Camera for GMS2

Want to get into 3D but got turned off by cameras and projections and all that nonsense? I just released my open source 3D camera project: EZ3DCam.

The above example project demonstrates:
  • simple planes
  • mixed 2D and 3D
  • Free Flight
  • FPS
  • 3rd person
It's easy to use, can work for any number of 3D projects, and has a robust set of features. Such as:
  • Multiple Camera Modes:
  • FPS
  • Third Person
  • And Static 3rd with Tracking
  • Multiple Rotation Modes: Local (your standard FPS or 3PS) and World (6DOF flight)
  • Full rotational and positional freedom (no gimbal lock)
  • Simple Resolution and Aspect Ratio management (No need to worry about projection matrices)
  • FOV control
  • Familiar room coordinate system
  • Supports surface render target so you control how the 3D scene is drawn to your app surface!
  • Get 3D vectors for camera forward, up, and right for simple camera relative movement and strafing
  • And more!
I think it's pretty easy to set up and use.

You can clone the repo from here:
https://github.com/PixelatedPope/EZ3DCam

Feel free to ask any questions here.
 
Last edited:
Been trying to use this for my own experiments lately... and, holy crap, it is not EZ at all. I need to do a serious usability pass on this thing. If you tried this and found it to be a pain to use, stay tuned. I'm gonna clean this crap up.
 
Alright, I've updated the GitHub Repository to a new version. Check it out and see if its a bit easier to wrap your head around how to use it. I didn't include an example for "stationary camera tracking moving object" yet, but that's still on the to do list. I've updated the original post with a new preview video
 

EvanSki

King of Raccoons
I think its extremely cool, I'd love if you could make a tutorial on a quick run down on how the different parts work, mainly how to reposition (or orientation?, where the camera is looking in the fps example) the camera using your system is what i'm failing to understand properly
 
@EvanSki Yeah, a quick rundown would probably be a good idea. In the meantime, let me try to explain.

How you work with the camera depends heavily on the "mode" the camera is in. So for FPS controls, if you open up the FPS object you'll see what you need.

In the create event, I enable 3DCam and then set the position of the camera. Whenever you are dealing with position, scale, and orientation in EZ3DCam, you always use an array: [x,y,z].

In the step event I read input and determine if/how our position and orientation are changing.

For position, the key here is ez3Dcam_get_direction() and ez3Dcam_get_direction_right(). The first will return a 3D vector that describes "forward" based on the camera's current orientation. The second determines the "right" vector, which is used for strafing. (There's one for up as well)

I knock out the Z component of both of these since I only care about moving relative to the floor, then "scale" these vectors based on movement speed. I add them all together, and this results in a single 3D vector that represents my intended motion for this step, similar to having an hspeed and a vspeed.

Finally, instead of setting the position (which would necessitate getting the current position and then modifying it) there's a "change" position function: ez3dcam_change_position(). This takes, again, a 3D vector, but that vector is the one we just built that represents this step's desired motion. And with that, your camera changes positions in the room.

Orientation is a bit easier. ez3dcam_change_orientation() is used just like _change_position(). Give it a 3D vector that represents the rotational changes for the camera's orientation. [yaw, pitch, roll]. The FPS example doesn't support roll, so I just pass a 0, and changes to yaw are determined by the left and right keys, and pitch are determined by the up and down keys.
 

EvanSki

King of Raccoons
@EvanSki Yeah, a quick rundown would probably be a good idea. In the meantime, let me try to explain.

How you work with the camera depends heavily on the "mode" the camera is in. So for FPS controls, if you open up the FPS object you'll see what you need.

In the create event, I enable 3DCam and then set the position of the camera. Whenever you are dealing with position, scale, and orientation in EZ3DCam, you always use an array: [x,y,z].

In the step event I read input and determine if/how our position and orientation are changing.

For position, the key here is ez3Dcam_get_direction() and ez3Dcam_get_direction_right(). The first will return a 3D vector that describes "forward" based on the camera's current orientation. The second determines the "right" vector, which is used for strafing. (There's one for up as well)

I knock out the Z component of both of these since I only care about moving relative to the floor, then "scale" these vectors based on movement speed. I add them all together, and this results in a single 3D vector that represents my intended motion for this step, similar to having an hspeed and a vspeed.

Finally, instead of setting the position (which would necessitate getting the current position and then modifying it) there's a "change" position function: ez3dcam_change_position(). This takes, again, a 3D vector, but that vector is the one we just built that represents this step's desired motion. And with that, your camera changes positions in the room.

Orientation is a bit easier. ez3dcam_change_orientation() is used just like _change_position(). Give it a 3D vector that represents the rotational changes for the camera's orientation. [yaw, pitch, roll]. The FPS example doesn't support roll, so I just pass a 0, and changes to yaw are determined by the left and right keys, and pitch are determined by the up and down keys.
That helps a ton, thank you!
 
Top