Skip to main content
added 743 characters in body
Source Link
jabru
  • 113
  • 3

I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water-tight mesh.

A mesh basically consists of a list of points in 3D space (vectors with 3 entries) together with a list of 3 vectors of natural numbers, which specify the corner points of each triangle. Now, I would like to have a reflection whenever the trajectory of the ball crosses the triangle.

enter image description here

I would already be happy about pseudocode

The question is, how can I find if a trajectory crosses a triangle? and how to compute the reflection?

Remark: I would later like to play billiards of charged balls in magnetic fields. I can therefore not assume that the balls follow a straight line.

So what this will come down to is that I will have a differential equation solver integrating the differential equation over time and whenever the one of the triangles is crossed, it should invert the part of the velocity vector that is normal to the triangle.

according to the formula:

$$p \mapsto p - 2 \langle p, n \rangle n,$$

where $n$ is the normal vector of the triangle. I have all the components except for the mechanism that tells me, when a triangle is crossed. I would have an idea to how to see whether the trajectory crosses the plane spanned be the corner points of the triangle, but I already don't how to figure out whether the crossing happened inside the triangle or outside the triangle in the plane.

I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water-tight mesh.

A mesh basically consists of a list of points in 3D space (vectors with 3 entries) together with a list of 3 vectors of natural numbers, which specify the corner points of each triangle. Now, I would like to have a reflection whenever the trajectory of the ball crosses the triangle.

enter image description here

I would already be happy about pseudocode

The question is, how can I find if a trajectory crosses a triangle? and how to compute the reflection?

Remark: I would later like to play billiards of charged balls in magnetic fields. I can therefore not assume that the balls follow a straight line.

I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water-tight mesh.

A mesh basically consists of a list of points in 3D space (vectors with 3 entries) together with a list of 3 vectors of natural numbers, which specify the corner points of each triangle. Now, I would like to have a reflection whenever the trajectory of the ball crosses the triangle.

enter image description here

I would already be happy about pseudocode

The question is, how can I find if a trajectory crosses a triangle? and how to compute the reflection?

Remark: I would later like to play billiards of charged balls in magnetic fields. I can therefore not assume that the balls follow a straight line.

So what this will come down to is that I will have a differential equation solver integrating the differential equation over time and whenever the one of the triangles is crossed, it should invert the part of the velocity vector that is normal to the triangle.

according to the formula:

$$p \mapsto p - 2 \langle p, n \rangle n,$$

where $n$ is the normal vector of the triangle. I have all the components except for the mechanism that tells me, when a triangle is crossed. I would have an idea to how to see whether the trajectory crosses the plane spanned be the corner points of the triangle, but I already don't how to figure out whether the crossing happened inside the triangle or outside the triangle in the plane.

deleted 47 characters in body
Source Link
nicoguaro
  • 8.6k
  • 6
  • 26
  • 51

I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water tight-tight mesh.

A mesh basically consists of a list of points in 3D space (vectors with 3 entries) together with a list of 3 vectors of natural numbers, which specify the corner points of each triangle. Now, I would like to have a reflection whenever the trajectory of the ball crosses the triangle.

enter image description here

I would already be happy about pseudocode

So, technically theThe question is, how can I find if a let the trajectory now it is crossing thecrosses a triangle? and it should perform ahow to compute the reflection.?

Remark: I would later like to play billiards of charged balls in magnetic fields. I can therefore not assume that the balls follow a straight line.

Any ideas?

I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water tight mesh.

A mesh basically consists of a list of points in 3D space (vectors with 3 entries) together with a list of 3 vectors of natural numbers, which specify the corner points of each triangle. Now I would like to have a reflection whenever the trajectory of the ball crosses the triangle.

enter image description here

I would already be happy about pseudocode

So, technically the question is, how can I find a let the trajectory now it is crossing the triangle and it should perform a reflection.

Remark: I would later like to play billiards of charged balls in magnetic fields. I can therefore not assume that the balls follow a straight line.

Any ideas?

I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water-tight mesh.

A mesh basically consists of a list of points in 3D space (vectors with 3 entries) together with a list of 3 vectors of natural numbers, which specify the corner points of each triangle. Now, I would like to have a reflection whenever the trajectory of the ball crosses the triangle.

enter image description here

I would already be happy about pseudocode

The question is, how can I find if a trajectory crosses a triangle? and how to compute the reflection?

Remark: I would later like to play billiards of charged balls in magnetic fields. I can therefore not assume that the balls follow a straight line.

Source Link
jabru
  • 113
  • 3

Billiard reflection inside a triangular mesh

I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water tight mesh.

A mesh basically consists of a list of points in 3D space (vectors with 3 entries) together with a list of 3 vectors of natural numbers, which specify the corner points of each triangle. Now I would like to have a reflection whenever the trajectory of the ball crosses the triangle.

enter image description here

I would already be happy about pseudocode

So, technically the question is, how can I find a let the trajectory now it is crossing the triangle and it should perform a reflection.

Remark: I would later like to play billiards of charged balls in magnetic fields. I can therefore not assume that the balls follow a straight line.

Any ideas?