Determine new travel direction

  • Context: Graduate 
  • Thread starter Thread starter levydee
  • Start date Start date
  • Tags Tags
    Direction Travel
Click For Summary

Discussion Overview

The discussion revolves around determining the new travel direction of a smiley face in a physics engine upon collision with a wall. Participants explore various approaches to handle the collision dynamics, including the application of the Möller–Trumbore ray-triangle intersection algorithm and the implications of different types of collisions.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant seeks a mathematical method to adjust the travel direction of the smiley face upon collision, specifically stopping the x-axis movement and modifying the z-axis movement.
  • Another participant questions the type of interaction between the smiley face and the wall, suggesting various collision types such as elastic, inelastic, or sticky.
  • A participant clarifies that the context does not involve elasticity and that the smiley face's movement is controlled by keyboard input, indicating a need for a more elegant solution rather than basic bounding checks.
  • There is a suggestion that the original poster (OP) may have misunderstood the concept of "elastic" collisions and that the type of collision chosen will significantly affect the simulation results.
  • One participant proposes that the OP could simulate the collision by reflecting the smiley off the barrier or adjusting its speed based on the collision type.
  • Another participant emphasizes that there is insufficient information to provide a definitive answer to the OP's initial question.

Areas of Agreement / Disagreement

Participants express differing views on the nature of the collision and its implications for the smiley face's movement. There is no consensus on the best approach to simulate the collision dynamics, and the discussion remains unresolved regarding the specific method to be used.

Contextual Notes

The discussion highlights the need for clarity on collision types and their effects on movement, as well as the limitations of the initial information provided by the OP.

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: 372
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.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K