tim-speed / openmap-gta

Old styled GTA game using open map data
13 stars 1 forks source link

Work on Player Movement & Controls #5

Closed Glavin001 closed 11 years ago

Glavin001 commented 11 years ago

Using the camera.position you can place the player's camera at any position, and fairly easily. What is not easy is using camera.lookAt because you must specify a point that the player's camera is looking at -- which is difficult, as there really is no absolute point. However, this can be calculated by simply imaging the lookAt point on an imaginary sphere around the camera.position. For varying mouse-speeds you can imagine a sphere with a larger/smaller radius.

camera-view view2 view3

Example project with code with draggable camera views: http://www.mrdoob.com/projects/voxels/#A/

Glavin001 commented 11 years ago

Read this issue thread, especially this comment: https://github.com/mrdoob/three.js/issues/1274#issuecomment-3908546

Going to use camera.rotation

Glavin001 commented 11 years ago

Improve fluidity of player movement and controls. http://stackoverflow.com/questions/5203407/javascript-multiple-keys-pressed-at-once