Renderer.car.frame
to replace the white triangle with the car you modeled in code1_transformations
implement the chase camera> The chase camera is camera that follows the car from behind and slightly above, as shown in the figure. You need to define this camera in the object frame of the car and then transform it into world space. Then you only need to setup the view matrix with the resulting camera. The numbers shown in the illustration below are justs example, place you chase camera where you like
Renderer.car.wheelsAngle
to rotate the front wheels so to how then the car is turning Renderer.car.speed
to rotate all wheels according to the speed of the car (and the diameter of your wheels). It does not need to be phyiscally accurate Game.scene.weather.sunLightDirection
for the direction of the sun to use a directional light. Game.scene.lamps
is an array of streetlamps, each lamp has a position and an height value. Place one spothlight for each lamp pointing down
Game.scene.trackObj
and Game.scene.groundObj
already have texture coordinates in the buffer texCoords
The u
texture coordinate for the vertices of the track is set as the length of the track up to that point. The v
is 0 for the vertices on one side of the track and 1 for the vertices in the other side.)
Game.scene.buildingsObjTex[i]
: facades of the i-th building Game.scene.buildingsObjTex[i].roof
: roof of the i-th building common/textures
or you can find textures of your liking on the internet, for examplecommon/textures/headlights.png
.