Results 1 to 2 of 2

Math Help - Rotation toward target vector, finding orientation of object?

  1. #1
    Newbie
    Joined
    Aug 2009
    Posts
    1

    Rotation toward target vector, finding orientation of object?

    Okay, I'm by no means a mathematics wizard. I was required in college to get a math minor and every course was pretty brutal so bear with me if this seems remarkably obvious to some of you.

    Here's my problem. I'm working on a graphics program. I'm doing a bit of 3D visualization programming (which I'm also not especially great at.. but whatareyagonnado..) in which I have a few 3D models moving through an open space.

    Each model is represented by a 4x4 matrix: The first three rows of the matrix represent the rotation/orientation of the model relative to the absolute world XYZ axis.. first is the x orientation, second is y, third is z. The last row is the model's translation away from the absolute world origin (0,0,0).

    (I'm assuming most of you found that really obvious but then again I'm really bad at explaining things, particularly in math, so excuse me while I go overboard..)

    Thus if we have a model of a jet, and the wings are parallel to it's x-axis and the body is parallel to the y-axis, and at the moment the model's matrix was:
    0 1 0 0
    0 0 1 0
    1 0 0 0
    10 10 10 1

    Then the model is at (10,10,10), with it's nose pointed straight up the x-axis and wings parallel to the y-axis.

    (Alright that was probably far more explanation than need be but like I said, I tend to explain things poorly..)

    Anyway... what I'm trying to do now is figure out how to orient the y-axis of the model toward a target XYZ location. Now, I know how to come up with a target vector... (targetXYZ-locationXYZ)/(magnitude). I was going to use that as the y-vector in the model matrix, but I can't figure out what to use as the x and z vectors. ie. the wings vector and the top of the plane vector.

    Any help with this would be IMMENSELY appreciated. I've taken a linear algebra course, but obviously not a great deal of it stuck. Haha.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Junior Member
    Joined
    Aug 2009
    Posts
    67
    as i understand you r probably trying to apply a affine transformation of the form Av+b, where A is an orthogonal isometry and b is some vector. assuimng that your orginal plane is aligned with the x-axis and you need to tilt its y-axis (called j vector) to (say) v direction. v is auusmed normalized. let us call the vector perp to the plane (j,v) as n.

    find the matrix for this rotation -- axis is n and j rotates to v.

    this matrix is your answer.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 0
    Last Post: January 14th 2012, 08:02 PM
  2. Replies: 2
    Last Post: March 22nd 2011, 04:08 PM
  3. Replies: 5
    Last Post: February 15th 2011, 12:34 AM
  4. Vector to rotation
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: January 30th 2011, 12:34 PM
  5. Finding a function's coefficients from inputs and target outputs
    Posted in the Advanced Applied Math Forum
    Replies: 8
    Last Post: January 5th 2011, 11:37 AM

Search Tags


/mathhelpforum @mathhelpforum