
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
An overview of the course.
Using Web Server for Chrome to easily setup a local http server to use for development.
Update:
Web Server for Chrome is a Chrome App and Chrome Apps are being discontinued. Instead use Simple Web Server - https://simplewebserver.org/. Created by the same developer it works in the same way.
Create a New Server
Choose the folder
Click the blue link to open in your browser
A brief overview of 3D graphics
Some useful sites for sourcing assets for your car racing game.
A short video showing how to download and begin using Blender.
An introduction to the THREE.js website.
Create a first 3D app using THREE.js. Download the resources for the course to work along with the lecture.
How we can use the FBXLoader class to load and parse a FBX file to use in our game.
Introducing the CANNON.js library with a simple example. Make sure you have the resources from Lecture 7 when viewing this video.
Learn more about how to add rigid bodies to the CANNON World.
The CANNON physics library understands how to move bodies using forces and handles how these collide, but it does not contain a renderer. To see what is happening you need to visualise this content. In this video we look at two methods to do this.
Introducing the CANNON.RayCastVehicle class.
The CANNON.RayCastVehicle class has an addWheel method to add the wheels to the chassis. We look at this in this video.
We add a on screen joystick that works on desktop and mobile and use this to apply engine and steering forces to our car.
CANNON cannot understand collisions between an arbitrary mesh (TriMesh) and a Box. To overcome this limitation we need to add colliders in our game, that CANNON can calculate correctly. We discuss this limitation in this video.
It is important that your own assets are sized to be similar to the RayCastVehicle and that these are fairly sensible metre values. We discuss this in this video.
In your environment you need to add simple boxes that can be used as colliders by the CANNON physics library.
We look again at the FBXLoader class and its load method to show how to parse the assets to use in your game.
How we convert the simple colliders we've added to our environment fbx into Cannon Bodies.
How to create a sky background that moves with the camera.
No matter how good a driver you are eventually you will end up upside down and unable to continue. We look at resetting the car to a checkpoint.
How to use the include Preloader class to add a loading bar to your game.
We are getting closer and closer to a game. Let's add some sound using an easy to use SFX class.
With a little CSS we add a GUI to the game.
Adding the code to allow for customising the car.
Using media queries to adjust the GUI for different screen resolutions.
We've come a long way in a short time on this course and no is time to take stock of what you've learnt.
It doesn't end there. Take a look at my other THREE.js and CANNON.js courses.
Creating a car racing game that works in a browser including mobile devices has never been easier. Using the two Open Source libraries THREE.js and CANNON.js this course takes you through the steps you will need to know and builds towards a complete car racing game. On the way you will learn
How to setup your development environment
How to access free and low cost assets to use in your game.
How to edit those assets to work with the THREE.js and CANNON.js libraries.
How to use THREE.js to add 3D to an HTML page.
The basics of THREE.js lights, cameras and meshes.
The basics of the CANNON.js library, including rigid bodies.
How to debug your physics either using the CannonDebugRenderer or using the CannonHelper class created by the author. Both are included in the resources for the course.
How to use the CANNON.RayCastVehicle class to add a car with suspension and fully working wheels.
How to apply your own assets to the RayCastVehicle and add colliders so it bumps into your content.
How to add a responsive GUI to the game
The course includes the assets for car racing game as shown in the course image and promo video. The author has won awards for the 3D games he has produced. Learn from an expert who has been creating games for over 30 years. The game we'll develop allows the player to choose from optional, body, engine, exhaust and wheels. It involves driving a remote controlled car around a garden track.
It's a great way to improve your JavaScript skills along the way. All code uses the latest ES6 style, using classes throughout.