Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Determine new travel direction

  1. May 29, 2013 #1
    Using the given information, is it possible to solve the new travel direction of the smiley face? To clarify, I am casting a ray using the Möller–Trumbore ray-triangle intersection algorithm.http://http://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm by casting the ray in the travel direction of the smiley face, I can determine how far away from said plane I am. When I hit that point, is their a mathematical way to, in this specific case, stop the x axis from advancing, and advance the z axis at half the rate?

    If any clarification is needed please let me know.

    Thank you.
     

    Attached Files:

  2. jcsd
  3. May 29, 2013 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Which kind of interaction do you have between the wall and the smiley?
    A perfect elastic collision? Reverse the x-component, keep the z-component.
    Perfect inelastic? Set the x-component to zero, keep the z-component
    Sticky? Set both components to zero
    Something else?
     
  4. May 29, 2013 #3
    This is not necessarily a physics question. Elasticity is not a factor in the context of the intended use. Basically the plane is static and the smiley face is controlled by keyboard input(W,A,S,D). I can muscle in some bounding checks between objects, but I am looking for more of an eloquent solution. I am a programmer and am working on a physics engine. Collisions between dynamic bodies is handled else where.
     
  5. May 29, 2013 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    What is your question then?
    In your code, you can set every component to everything you like, but most results will look unrealistic.
     
  6. May 29, 2013 #5
    Ok, so using the picture provided, assume my smiley face is moving at -10 arbitrary units on the X axis, and 10 arbitrary units on the Z axis. When the smiley face contacts the wall(knowing its travel vector and the planes normal), I want to now move at 0 units on the X axis, and move at 5 units on the Z axis. Just as an example. I guess I am looking for some formula, or algorithm to simulate that. Im sorry if I am in the wrong forums. I am just looking for some tips or opinions.

    Thank you
     
  7. May 29, 2013 #6

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Simulate what, in which way?
    Let it move step by step? Then you just need the previous position and the current velocity for each step.
    Calculate its position after some specific time? Simple algebra (addition and multiplication) with both components.
     
  8. May 29, 2013 #7

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    I wonder of OP has misunderstood what is meant by "elastic"?
    What happens in the collision depends on what type of collision you want - in a computer program you can pick any kind of collision you like and simulate it.
    Therefore we cannot help you the way you want unless you make a decision here.

    What would be wrong, for example, just "reflecting" the smiley off the barrier?
    Do you want the barrier to be a bit sticky so the smiley loses some speed after the collision?
    Do you want the velocity of the barrier to add or remove something to/from the smiley?

    The short answer to the question in post #1 is "no", there is not enough information.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Determine new travel direction
  1. Direct product (Replies: 3)

  2. Direct Sum (Replies: 4)

  3. Direct limits (Replies: 1)

Loading...