Creating a 3D browser game with physics in a few steps.
This time we will talk about creating of basketball net (with physics), the way we will keep the ball, and throw it in different directions depending on mouse position. If you haven’t read a Part 1: Getting workflow ready, read it first, please. I describe there what to start with, how to create basic scene elements (ball, basket, wall and ground).
Two more files.
We compile this project using rollup.js, it means we can use es6 moduleswithout any restrictions. Let’s add two files that will handle: 1) Events, 2)Loops.
We’ll back to them soon, but let’s create a backboard and a basketball net first.
Backboard & basketball net
Backboard is just a WHS.Box with applied map, normalMap (defines how light will be casted on texture) and displacementMap. Backboard will be 41 x 28 and with depth of 1. We don’t want backboard to fall down, so it’s mass will be 0 as with wall and ground. Continue Reading →