Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Create a 3D Car Racing Game with THREE.js and CANNON.js
Rating: 3.8 out of 5(175 ratings)
1,569 students

Create a 3D Car Racing Game with THREE.js and CANNON.js

Use the CANNON.js physics library and the WebGL library, THREE.js, to easily create a car racing game.
Created byNicholas Lever
Last updated 7/2025
English

What you'll learn

  • You will have a knowledge of the THREE js library.
  • You will have a working knowledge of how a physics engine works. Particularly CANNON js
  • You will know how to adapt your assets to work with the CANNON RayCastVehicle class.
  • You'll know how to use the position and rotation information from the physics engine and apply it to your assets.
  • You will know how to use colliders in your scene to prevent your car driving through your 3d environment.

Coding Exercises

This course includes our updated coding exercises so you can practice your skills as you learn.

See a demo
Image of coding exercise example

Course content

7 sections34 lectures2h 20m total length
  • Welcome to the course0:18
  • JavaScript in 12 Easy Lessons - e-book0:28
  • The ThreeJS Primer - FREE e-book0:28
  • Introduction2:25

    An overview of the course.

  • Setting up a Web Server3:19

    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.

    1. Create a New Server

    2. Choose the folder

    3. Click the blue link to open in your browser

  • 3D Basics3:58

    A brief overview of 3D graphics

  • How to get your assets3:46

    Some useful sites for sourcing assets for your car racing game.

  • Using Blender3:39

    A short video showing how to download and begin using Blender.

  • Test your knowledge

Requirements

  • You need to know basic Javascript.
  • The tools required are a good text editor and optionally a 3D application program that exports FBX files such as Blender.

Description

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

  1. How to setup your development environment

  2. How to access free and low cost assets to use in your game.

  3. How to edit those assets to work with the THREE.js and CANNON.js libraries.

  4. How to use THREE.js to add 3D to an HTML page.

  5. The basics of THREE.js lights, cameras and meshes.

  6. The basics of the CANNON.js library, including rigid bodies.

  7. 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.

  8. How to use the CANNON.RayCastVehicle class to add a car with suspension and fully working wheels.

  9. How to apply your own assets to the RayCastVehicle and add colliders so it bumps into your content.

  10. 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. 

Who this course is for:

  • If you are interested in developing 3D games that work in the browser including on mobile devices.
  • If you are interested in learning how physics engines work while creating a fun game.
  • If you want to know how to add a responsive GUI to your game.