Results 1 to 6 of 6

Thread: Vectors and Planes (as always)

  1. #1
    Zaei
    Guest

    Vectors and Planes (as always)

    Ok, just for setup. Working in 3D space, with the Y axis defining Up, I have a plane, defined by 3 random points. I also have a vector tht runs along the XZ plane (flat). How would I find the vector that would follow the first plane in the direction defined by the vector on the XZ Plane? Thanks much.

    Z.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    scalar product
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    i'm sorry i got a bit confused with your explanation. The X and Y components should inherit the vector in Z=0, Z can be evaluated by the plane equation if you set it's X and Y components to the X and Y components of the vector in Z=0.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Zaei
    Guest
    Thanks kedaman. Its working pretty well, except the value I come out with is always negative. Im doing it like this:
    Code:
    Vel.y = (-pln.d - (pln.a*Pos.x) - (pln.c*Pos.z)) / pln.b;
    Otherwise, It works like a charm. Know what's wrong?

    Z.

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I don't know what your a, b and c's are, but i suspect you've missed something in the equation
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Zaei
    Guest
    Yeah, I figured it out last night. The equation should be:
    Code:
    Vel.y = ((-pln.d - (pln.a*(Pos.x+Vel.x)) - (pln.c*(Pos.z+Vel.z))) / pln.b) - Pos.y;
    Thanks for the help =).

    Z.

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