three-rs / three

[abandoned] Totally not inspired Rust 3D library
Apache License 2.0
555 stars 46 forks source link

Need a perspective camera #47

Closed shmutalov closed 7 years ago

shmutalov commented 7 years ago

I am requesting for perspective/fps camera support in the three-rs. Also WASD+mouse look like movement template will be good

Three-js have a PerspectiveCamera class: https://github.com/mrdoob/three.js/blob/dev/src/cameras/PerspectiveCamera.js

There is also example for using three-js perspective camera with FPS controls: https://github.com/josdirksen/learning-threejs/blob/master/chapter-09/07-first-person-camera.html

shmutalov commented 7 years ago

I did mistake. As I see perspective camera already implemented. Ok, we need just FirstPersonControls. I got that job, it is in progress now.

alteous commented 7 years ago

@shmutalov Is this still in progress?

shmutalov commented 7 years ago

No. I didnt get the success in doing that :(

vitvakatu commented 7 years ago

@alteous I had some problems with this too. I would ask you, but you seems a little bit busy with gltf now. I will make another try a bit later.

alteous commented 7 years ago

I have a first person camera implemented in the gltf example right now, but it uses the QE / RF keys to yaw / pitch respectively. When gltf support is finished I'll try to replace QE / RF with mouse controls instead.

vitvakatu commented 7 years ago

@alteous great!

shmutalov commented 7 years ago

@alteous I think, for the first time hardcoded keys is good, but we need to give the user provide custom keys for controlling the camera:

let cam = FPS.left_right(key::A, key::D).forward_backward(key::W, key::S);

^ something like that

vitvakatu commented 7 years ago

First person camera has been implemented