swift502 / Sketchbook

3D playground built on three.js and cannon.js.
https://jblaha.art/sketchbook/latest
MIT License
1.47k stars 389 forks source link

Cameras #38

Closed eachtime closed 3 years ago

eachtime commented 3 years ago

It was very easy, I should have started by doing that. sorry!

swift502 commented 3 years ago

I played around in the demo, and I appreciate your efforts, but I'm afraid your implementation isn't compatible with my idea of the GTA-style camera. Your changes are also quite vast and your implementation from a quick glance isn't up to my standard. But while the specific implementation could be easily improved, the general functionality just isn't what I was looking for.

My idea for the camera behavior

The most important thing is that our ideas for how the camera should behave are very different. For that reason alone I can't currently merge your changes. Hope you understand.

In my eyes, the behavior of the gta camera is quite well defined.

  1. The camera follows an entity using a very specific algorithm: a. Look at the car b. Set the distance between the camera and the entity to a specified radius

This results in a nice predictable behavior where the camera naturally orbits the entity it follows. For example, you seem to have implemented some sort of a car "reverse" camera, that's not what happens in GTA right? In GTA the camera naturally orbits so it's in front of the car, looking back.

  1. Joystick movement adjusts the camera orbit, but the camera still tends to fall into it's natural following algorithm. (I guess that's not applicable since Sketchbook doesn't support joystick input)

  2. Moving the mouse stops the following algorithm for several seconds (so it behaves like sketchbook currently does) and after a few seconds of no mouse input, the following logic kicks in again.

Your behavior is very different from how it behaves in GTA, which is what I wanted in Sketchbook. There's also too many camera modes for my personal taste, I feel the shortcuts are a bit impractical (I already closed my browser window by accidentally pressing ctrl+w), you can't seem to look around when you're driving in the first person, there seems to be micro-jittering on the default camera, etc., etc..


I'm just can't merge this into master, because the general idea isn't compatible with mine, sorry. But maybe there's no need. Sketchbook is my pet project where I implement stuff that I personally feel are right. This in a sense is your Sketchbook with your cool camera system right? 😃

Let me know what you want to do now. We can work further if you wanted to implement "my idea" of the camera behavior. But I don't expect you to want to do that.

eachtime commented 3 years ago

Anyway, I definitely want to try that blender empty object thing so I will correct my code, mess around a bit with blender and if I end up with something that worth showing, I come back at you. Thanks for all.

swift502 commented 3 years ago

Sure. 🙂

Your work is already very impressive. Just not what I personally had in mind.