Open lechszym opened 11 years ago
Is anyone working on this at the moment? If not, I might give it a try. Is the problem mostly quaternion related?
I don't know how to do this but I will work on #13 and GUI for changing avatars.
It will be a simple model rigged with arms and legs that will have some animation sequences such as "walk" and "jump" which need to get fired upon key presses. I can set an origin of the model so that rotations are made about that origin - perhaps the feet or body/pelvis.
I think this might be helpful for someone to implement a 'chase camera' around the character for 3rd person. http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:making_the_camera_follow_a_character
I was working on it, but I'm a bit busy now and not sure how much further I can go with it. My problem, which involved quaternions, was that I wasn't the player's view to stay fixed as the planet moved. So, for example, if the player is looking at the sun while the planet he or she is on rotates around it, the camera will always be looking at the sun. At the moment, the player is always looking in a direction, meaning when they have rotated 180 degrees around the sun, they will no longer be looking at the sun, but rather away from it.
The plan that I had was to use the "lookAt" method of the planet to "look at" the sun, so the planet was always looking in a direction relative to its orbit around the sun. Then, I would track the movement of the mouse and use it to create a rotation that could be added to the planet's rotation. Basically, if the mouse wasn't moved, the camera would always be facing the same direction as the planet, which would be towards the sun.
The problem I came up against was that setting the rotation of the camera requires using quaternions, which I didn't know how to use. Experimenting, I got really weird results. I don't know how well I have explained this.
Nevertheless, if you wish to take this task upon yourself, feel free.
Oh, wait. You are talking about movement. Movement didn't require quaternions at all. I have movement working. The only problem at the moment is that it's not completely obvious to me yet how to move in the direction the camera is facing. Because of this, the player doesn't move straight ahead, but rather in some other direction.
I think the code I have there is probably fine for movement, especially if moving from one planet to another is done by grappling hook. The main concerns would be:
I have started this and anybody who checks out the code can try this out by pressing the P key to toggle it and using the W key to move the "player" sphere forward. Unfortunately it doesn't move in the direction of the camera at the moment. Making this work properly is pushing my abilities to the limit, I believe, so if there is anybody better suited, that would be great. Otherwise, I can just bite the bullet, push forward and learn what I'm doing.