Thread: gravity: jittery camera.

  1. #16
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    hmm, so in pseudo code:
    Code:
    getcurrentpos();
    gettimebetweencurrentposandthecollisionpoint();
    if(raydosn'tend)
       keepgoing();
    else
       collide();
    I get what you're saying, but i'm still a little shaky on implementation.

    -psychopath
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  2. #17
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    Interpolating to find a point of intersection is not what I would do. There are several ways to go about this but the simple ray to triangle intersection test will do the trick nicely
    How do you make a ray without two points? Also, using a ray would be inappropriate since it sounds like there is a defined amount of displacement with these objects psycopath is using. But that's just being nit picky, the same math would be applied in either situation for the most part. The line segment will have to have a few more checks.

  3. #18

    Join Date
    May 2005
    Posts
    1,042
    The concept of how to do this isn't *that* hard to comprehend and implementing it is only a bit harder. Personally, I'd just ignore bubba because he often doesn't make sense. He knows what he's talking about, I'll give him that, just nobody else does.

    In psuedocode, if you're colliding against polygons:

    -Set a 'closest time' or 'smallest fration' variable to 1.0f, this will be your closest time of intersection.

    -For every polygon, find the time where the movement (defined by a start point and end point) intersects the polygon's plane, store the time of intersection (which will be a number between 0 and 1). If the time of intersection is not smaller than the 'closest time'/'smallest fraction' variable, continue to the next polygon, else:
    -If the movement intersects the plane, determine if the point of intersection
    -Determine if the point of intersection lays inside the triangle
    -Store the time of intersection in your closest time variable

    I outlined the math for every step of this, including how to find the point where a ray defined by two vectors intersects a plane and if that point lays inside the region of a triangle. I will repost it here ifyou want.
    I'm not immature, I'm refined in the opposite direction.

  4. #19
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I'd just ignore bubba because he often doesn't make sense. He knows what he's talking about, I'll give him that, just nobody else does.
    I think I'll just pretend that someone with just over 90 posts did not just flame another member with just over 2900. Yep, I think I'm just gonna act like I didn't read that.


  5. #20
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    hmm, ok, I think I have enough information to get this to work. i'll post again if I have any more trouble.

    >>He knows what he's talking about, I'll give him that, just nobody else does.<<
    mm, no actually, its just you that can't seem comprehend bubbas posts

    -psychopath
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. camera rotation matrix
    By Vick jr in forum Game Programming
    Replies: 5
    Last Post: 05-26-2009, 08:16 AM
  2. LNK2001 ERROR!!! need help
    By lifeafterdeath in forum C++ Programming
    Replies: 7
    Last Post: 05-27-2008, 05:05 PM
  3. Problems moving the camera
    By Mavix in forum Game Programming
    Replies: 8
    Last Post: 01-30-2008, 12:52 PM
  4. RTS camera movement
    By blurrymadness in forum C++ Programming
    Replies: 0
    Last Post: 04-22-2007, 10:37 PM
  5. Camera rotation/movement in 3D world
    By tegwin in forum Game Programming
    Replies: 11
    Last Post: 01-24-2003, 01:43 PM