Results 1 to 3 of 3

Thread: Turn Plane into Matrix

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Turn Plane into Matrix

    Alright I got some terrain collision detection routines working.
    Currently I am able to generate a sliding plane, ie. the plane which would slide the unit along a wall for example, or up the slant of a hill.

    I was wondering if there is anyway I can use that plane to determine what angle the plane is at so I can rotate certain objects to that angle.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051

    Re: Turn Plane into Matrix

    How are you representing the plane? You could be represeting it as an angle from each axis or as a vector normal to the plane, in which case i don't think it would be too tough to get the angle for an object.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  3. #3
    Fanatic Member sql_lall's Avatar
    Join Date
    Jul 2002
    Location
    Up Above (i.e. AUS)
    Posts
    571

    Re: Turn Plane into Matrix

    Sounds like you want the plane's NORMAL

    how are you representing the plane?
    if it's already as "Ax + By + Cz = D" then the normal is just (A, B, C)
    if you have the three points, you can use the vectors between them, find their cross product which also happens to be the normal to the plane!

    Once you've got the normal, which is just a 3D vector, you can do a conversion from that to spherical coordinates to get whichever angle you want

    For example, say you want the elevation...
    if in your game world, up/down is +/- Y (for example, the ground is the XZ plane), then to get elevation, you have one vector for your plane, and one for the base plane (in this case, the normal is just (0, 1, 0))
    Then, you find the angle between the normals, using the dot product. This (or 180 degrees - this...depends what you want) is then the angle between the planes, which is your plane's elevation
    sql_lall

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