Jump to content
  • Advertisement

kpalko

Member
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

114 Neutral

About kpalko

  • Rank
    Newbie
  1. I've decided to continue my Udacity course in the hopes that he'll go over this. I'm sure being exposed to it twice (once here, and once during the course) will help me understand it. Thanks for everyone's help.
  2.   I was noticing that ( 0, 0, 0 ) did seem pretty pointless. Was canceling everything else out--which makes sense. It was also helpful to hear, "An objects position is irrelevant and separate from its orientation." That makes a lot of sense.   Positioning takes place when they press W/A/S/D, but rotation occurs when they move the mouse. The two are distinct and should be treated differently. The only time the two would overlap is when you're wanting to move in the direction you're "facing", right? In which case you would move towards the Vector that stood for your orientation? I'm kind of piecing things together from what I've read. Let me know if that is correct.       Is this normalization based off the current position of the camera? If the camera is at ( 5, 0, 5 ) then we wouldn't want to normalize based on origin. That would always cause our Camera to be oriented towards ( 0, 0, 0 )ish, right? Would you need to add the Camera Position to the View Vector once you had recalculated it?       Quaternion who? Alright, but seriously, I'm forgetting about them. They only caused me pain and suffering anyways lol.       When you said "forward" is pointing "east" did you mean West? If not I didn't follow that part. If we turn left our right is now North, and if we go around the compass directions clockwise east would be behind us, right? You also mentioned (later) that camera's do the opposite, so maybe this is a sign of me not understanding that part.   The only question I have about the W part is why do I need it. I guess when transforming matrices it has something to do with the math? If that's the case, that will suffice to explain it to me.   The columns are a little confusing as well, but I know next to nothing about Matrix Transformations, so I guess I'll study that next.       "You just move everything the opposite way of your imaginary camera." I think I will need to experiment with this to see how this occurs. I guess I have noticed when manipulating the camera everything does seem to go the opposite way of what I input... But I thought maybe I was just misunderstanding the way the X/Y/Z was oriented. For instance, if I move an object from ( 0, 0, -5 ) to ( -1, 0, -5 ) I would expect it to move left, but it moves right.       I must say this is probably the most foreign of all concepts. The fact that we can rotate around Vectors. It's very difficult for me to visualize. In the previous example of rotating 90 degrees to the left, that makes sense. But thinking of rotating around a Vector not using plain English is difficult. If you can give an example of what it would take to rotate 90 degrees to the left that might be helpful, but if you think I can pick that up myself from reading online I can try that.   Thanks for taking the time to break down what I need to do. I'm spending my lunch studying this breakdown. Thanks again!   EDIT: I'm beginning to think that the world should move, not the camera. This would help with normalizing the length, I think.
  3. So, I'm trying to write it in layman's terms... Here is what I have so far, but it doesn't seem to be working: (function() { var rotationRadians = THREE.Math.degToRad(90); var viewVector = new THREE.Vector3( 0, 0, 0 ); var viewQuat = new THREE.Quaternion( viewVector.x, viewVector.y, viewVector.z, 0 ); var viewRotationVector = new THREE.Quaternion( 0, 0, 0 ); var viewRotationQuat = new THREE.Quaternion( viewRotationVector.x * Math.sin(rotationRadians/2), viewRotationVector.y * Math.sin(rotationRadians/2), viewRotationVector.z * Math.sin(rotationRadians/2), Math.cos(rotationRadians/2) ); var rotatedQuat = viewRotationQuat.multiply(viewQuat); var conjugate = viewRotationQuat.conjugate(); rotatedQuat.multiply(conjugate); viewVector.x = rotatedQuat.x; viewVector.y = rotatedQuat.y; viewVector.z = rotatedQuat.z; console.log(viewVector); })(); Also, if my camera is placed at 0,0,0, should be view vector also be placed there (as well as the rotation)? I'm using this GameDev article to try and figure it out... I feel like I'm getting closer but I'm missing some very important details...   http://www.gamedev.net/page/resources/_/technical/math-and-physics/a-simple-quaternion-based-camera-r1997
  4. You all are awesome! Thanks for the replies.     Right now I'm just playing with the camera. I've added it to the scene at 0, 0, 0. I've gotten it to rotate using camera.rotation.x/y. From what I've seen, other people seem to implement a vector that the camera "looks at" (using the .lookAt function). Really I just want to create a camera that allows me to look around in the scene. I put a cube at 0, 0, 5 and just want to be able to move the camera around and look at the cube from different angles. For the development I'm using Threejs (threejs.org).       I'm at work now, but I'll check this out when I get home. So just so I'm understanding the basics correctly...   Orientation returns a Matrix (x,y,z,w), which is two Quaternions multiplied together. I'm guessing the * has been overloaded to support multiplying Quaternions? The second part is a little difficult to understand. I can't find a resource to define what the translate method takes in and returns. Would mTranslation be the vector my camera was currently located at?
  5. I've been studying for 4 days straight trying to figure out how to make a camera that behaves like one does in FPS games. I've been lead to believe I need Quaternions for this, but I also see a lot of talk about Euler angles and Yaw/Pitch/Roll.   If it is Quaternion angles, can someone give me a very basic example of how you would make a camera look up 45 degrees using a Quaternion?   I prefer to leave the mouse calculations out because they just seem to make it more difficult to understand.   Any help would be greatly appreciated as I'm getting close to giving up :(   Thanks
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!