Jump to content
  • Advertisement

Naruto-kun

Member
  • Content count

    159
  • Joined

  • Last visited

Community Reputation

443 Neutral

About Naruto-kun

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. Naruto-kun

    A transformation problem

    (facepalm) I have done this rotation on numerous occasions before. Somehow I got my sines and cosines mixed up. Resolved.
  2. Naruto-kun

    A transformation problem

    Hi guys I have a bit of a transformation challenge to deal with here. I have modelled the sensor outputs of a 3 axis ring laser gyro system which detects the earth's rotation. As you can see in the first image, a simple atan2 of the Prate and the R rate is sufficient to determine true heading. However if the local horizon pitch or bank angle is changed, I can no longer use a simple atan2. In this second image, you can see pitch is set to -1.5 deg. Now the R rate has decreased and I have a signal on the Y rate gyro. This produces an error in the atan2 output even though actual heading has not changed. Any suggestions on how to correct for this? I haven't been successful in my attempts to invert the pitch and roll rotations. Thanks JB
  3. Naruto-kun

    Qdot from 2 quaternions

    Thanks a bunch. Once I have sorted out the polarity I take it I just subtract each individual element in the quaternion? And dividing by dt I take it is again simply dividing each individual element by dt?
  4. Naruto-kun

    Qdot from 2 quaternions

    Hi guys I have a bit of a challenge here. I am attempting to determine body rotation rates from 2 Tait-Bryan angles. I have each set of angles converted to a quaternion, and the time step dt. I know that the formula for obtaining body rotation rates is 2*(qd/dt)*inverse of q. My question is, how do I determine qd/dt from 2 orientation quaternions, and which quaternion I would invert. Thanks JB
  5. Yes. I don't have the source code and am having to rely on a undocumented function that I located in one of the dll export lists. To give you an idea what also occurs, if I have the camera pointing in the same direction as the aircraft nose, and I pitch the nose up, the camera pitch/bank/heading values will be the same as the aircraft. However, if I rotate the camera 90 deg horizontally to the side, the camera pitch/bank values will be swapped.
  6.   Am aware of the dangers but they do not apply in what I am trying to achieve.   That is the idea yes. I want to know where the camera is looking relative to the aircraft nose. The purpose ranges from a 3D sound engine, to helmet mounted sights. I can get the aircraft pitch/bank/heading and make a rotation matrix out of it (inverting the signs of course to un-rotate as you say), and this works on locating the head position relative to the aircraft. But for some reason it isn't working on the heading rotation relative to the aircraft. Yes it is a SR-71.
  7. I also tried this solution from a much older topic of mine (I left off this problem due to other duties at work for a while) but I only got confused from it. https://www.gamedev.net/topic/681548-converting-world-rotation-to-body-rotation/?view=findpost&p=5308675
  8. I see I am still not quite understood....I tried Alundra's idea (multiplying the camera rotation matrix by the inverse aircraft rotation matrix and then decomposing the resultant matrix into its Euler angles as per this site: http://nghiaho.com/?page_id=846 ) However, this is the result I get. As you can see in this picture, the camera pitch and bank relative to the aircraft are correct (0), as is the heading (-48.83). In this next picture, the camera angle relative to the aircraft is again correct in pitch (-38.78) and bank and heading (0). The moment I combine a pitch and heading change however, this is what I get. Bank should still be 0 but as you can see it isn't. Any suggestions?
  9. Yes the camera follows the cone and can be offset from it. I'm not sure I follow exactly though. The cone has its own local transformation which affects the world transformation as well as the camera. Basically, if I roll the cone by -25 deg, set the pitch of the cone to 0, and then rotate the camera heading(yaw) by -90 deg, the camera transform will show a heading of -90 deg, a bank angle of 0, and a pitch angle of -25 deg. If I rotate the camera heading back to 0, pitch will be the same as the cone (0) and roll will be the same as the cone (-25). I need to calculate the local angles of the camera relative to the cone so that if I rotate the camera heading by -90 deg, no matter what pitch/roll values I will get the a heading of -90 deg, pitch 0, bank 0.
  10. Hi guys I have a bit of a challenge here. It is best illustrated in the below screenshots: In this scene, the camera is linked in hierarchy to the cone. The cone has 0 rotation on it. The camera is rotated to the left (yaw motion) by 15 degrees (see the Z value in the bottom right corner). I then rotate the cone upwards (pitch motion on the X axis) by 30 degrees using the World transform. But then I switch from the World transform to the local and rotate the cone around the Y axis (roll motion) by -25 deg (ie to the left). The camera is linked to the cone and follows it through these motions. You can see the rotation values in the bottom right corner. The above illustrates a problem I am trying to solve using reverse engineered data from a flight simulator. I have the camera world rotation angles, and the aircraft (represented by the cone) world rotation angles in pitch and heading(yaw). My end goal is to calculate the camera rotation angle relative to the local aircraft rotation angles. But I am getting thrown for a loop by the switch to local in roll axis. Anyone have any suggestions?
  11. Naruto-kun

    Direction to point for lighting purposes

    Perfect. Thanks a bunch.
  12. Hi guys I am working on a directional light system, where the light is collocated with the camera position. As such, the lighting returns will depend on the direction to the surface from the camera position. I want to get the eye direction to this point so I can perform the dot product calculation on it with the surface normal and determine how much light is reflected back. Would I simply normalize the vertex position after multiplying it by the view matrix? Thanks JB
  13. Naruto-kun

    Converting world rotation to body rotation

    Thanks a bunch. Apologies for the misunderstanding.
  14. Naruto-kun

    Converting world rotation to body rotation

    I need the camera rotation for custom 3D sound engine purposes. Since I didn't create the camera (it is created internally by the simulator and I have to use a bit of reverse engineering to get hold of it) I need to be able to transform it so that I know where it is looking relative to the nose of the aircraft.
  15. Naruto-kun

    Distance to a pixel

    Looking over the output results, it appears that the x and y values of the vector after being multiplied by the inverse projection matrix are the angles to the pixel in radians (x converted to degrees is roughly -60 which fits with my horizontal FOV of 120 deg, and y is roughly 3.75 deg which fits my vertical FOV of 7.5 deg). I'm guessing the key is in what relationship the z and w values have with my far and near clip planes?
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!