Building your first 3D game with the Q3D plugin

2

Index

Attached Files

The following files have been attached to this tutorial:

.capx

q3dsamplegame.capx

Download now 227.95 KB

Stats

19,837 visits, 40,983 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 14 Mar, 2017. Last updated 19 Feb, 2019

Part IV – The Event Sheet - The "CAMERA" Group

Lets face it. Cameras are a big deal in 3D. If you are making a 3D game, the camera is potentially the most complex part of giving the user a good experience. The sole purpose of the camera is to show the player what they need to know. In a top-down game, this means that you need to make sure that the player is always visible, with nothing obstructing the view of the player. For this reason, in this tutorial, we have intentionally not given the player the ability to drive under something.

One of the basic tenets of 3D game cameras is that the camera should move with the player. This means that if the player moves, the camera should "translate" instead of "rotating". Mathematically, this makes your life easy, as the simplest way to do this is:

1. Every tick, set the camerpoint to a (carbody.x+500,carbody.y+500,5000) - significantly above, and at a slight angle to the player. Note that we have kept the z height at 5000 so that we can see the player move with respect to the ground, rather than the ground moving with respect to the player. The latter can cause simulation sickness in some players.

2. Every tick, set the camera to the location of the camerapoint.

3. Every tick, rotate the camera toward the player.

The screenshot below shows the events for the camera.

I strongly recommend watching the following video for further guidance on game cameras:

50 Game Camera Mistakes (YouTube)

  • 7 Comments

  • Order by
Want to leave a comment? Login or Register an account!