Determine new travel direction

  • Thread starter Thread starter levydee
  • Start date Start date
  • Tags Tags
    Direction Travel
levydee
Messages
4
Reaction score
0
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.
 

Attachments

  • Math issue.jpg
    Math issue.jpg
    8.5 KB · Views: 346
Physics news on Phys.org
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?
 
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.
 
What is your question then?
In your code, you can set every component to everything you like, but most results will look unrealistic.
 
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. I am sorry if I am in the wrong forums. I am just looking for some tips or opinions.

Thank you
 
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.
 
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.
 
Back
Top