Results 1 to 6 of 6

Thread: Matrices? Huh?

  1. #1

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Matrices? Huh?

    How do I use the world matrix to rotate objects...? Or am I looking at the wrong thing? If so, what should I use to create the objects?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  2. #2
    Zaei
    Guest
    Multiply tranlation, scaling, and rotation matrices, to get them to rotate, as well as move or scale.

    Z.

  3. #3

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    But HOW do I get these matrices from the Vertices?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Addicted Member
    Join Date
    Apr 2000
    Location
    England
    Posts
    246
    a Vertex maxtrix is simply (x,y,z) you multiply it by a rotation maxtrix (don't ask me the values, once upon a time i knew but not now) and the answer is a new (x,y,z)

    isn't there something built into direct x to do this for you? Multiplying maxtrixs in code gives me a headache, i made my library to handle it ages ago and haven't touched it since
    Some Days, i just get this feeling that i'm helping to write dozens of Viruses...

  5. #5
    Zaei
    Guest
    Actually, you cant do <x, y, z> * 4x4 matrix(A 3D transformation). Vertices have to be in the form <x, y, z, w>. The w value is a scaler value, and is usually 1. If you are using DirectX, the World Matrix will be applied to any vertices passing through the transformation pipeline. So, if you wanted to rotate a model,you would set the world matrix to a rotation matrix you had created, then draw the model. If you then wanted to draw another model at a different rotation, just change the world matrix, and draw the second model and both models will draw correctly.

    Z.

  6. #6

    Thread Starter
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    That makes sense, just like changing textures and materials and such... Thanks both of you.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width