cross product?

This is a discussion on cross product? within the Game Programming forums, part of the General Programming Boards category; This is something that I understand but I'm little puzzled about... why do you want something that is perpendicular to ...

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    71

    cross product?

    This is something that I understand but I'm little puzzled about...
    why do you want something that is perpendicular to both vector a and b?
    It's like looking at the sky when crossing the road instead of looking left and right.
    Can somebody tell me what application this is good for???

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Getting the normal to a plane, given stuff in the plane.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    71
    Quote Originally Posted by tabstop View Post
    Getting the normal to a plane, given stuff in the plane.
    yes but why is it useful?
    example???

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I think, not being an expert on the subject, that the normal indicates which way the plane is facing, which is useful when figuring out whether a plane is visible or not in a 3D drawing.

    --
    Mast
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    The normal of a plane is also used to calculate lighting and collision detection among other things in 3D graphics.

  6. #6
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Collision detection, IIRC.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  7. #7
    Registered User
    Join Date
    Jul 2008
    Posts
    71
    Thanks for all your replies.
    Now I have at least a concrete idea on it's application....

  8. #8
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    The cross product is also useful for determining the axis of rotation when rotating from one orientation to another.

    EDIT:

    As an example if you have two objects and you want to rotate one to face the other you would create a vector from the target object to the active object. You would then cross the look vector of the active object with the vector to the target object. Normalize this and it becomes the axis of rotation to rotate to face the target object. Take the dot product to get the cosine of the angle of rotation and then create an axis angle rotation matrix using this information.

    The cross product is excellent for finding up/down relative to any orientation since it always returns a vector perpendicular to the two being crossed.
    Last edited by VirtualAce; 09-06-2008 at 01:14 PM.

  9. #9
    Registered User
    Join Date
    Jul 2008
    Posts
    71
    ^little hard time visualizing it but I think I understand it's application.
    wow,pieces by pieces all those abstract mathematical notation started to made sense in the real world.
    Thanks for your answer

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Minimax, URGENT :(
    By Dark-MX0Z in forum C++ Programming
    Replies: 6
    Last Post: 11-14-2007, 05:29 AM
  2. ...multiplication using stacks
    By iiwhitexb0iii in forum C Programming
    Replies: 1
    Last Post: 10-09-2006, 01:28 AM
  3. Cross Product
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 04-24-2004, 11:05 PM
  4. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21