How Do You Calculate Arc Points for Collision Detection in 3D Space?

  • Context: Undergrad 
  • Thread starter Thread starter jschieck
  • Start date Start date
  • Tags Tags
    3d Ellipse Points
Click For Summary
SUMMARY

This discussion focuses on calculating arc points for collision detection in 3D space, specifically for a grenade launcher-type weapon. The user seeks to determine points along an ellipse based on player and target positions, utilizing vector3 coordinates. Key formulas provided include \frac{x}{e}-d^x + 1 and \frac{x}{e}-d^{\frac{x}{10}} + 1, where e is defined as \frac{\sin(\alpha)}{\sin(45^{\circ})}, with \alpha being the launch angle. The discussion emphasizes the need for interpolation between the calculated points to accurately simulate projectile trajectories.

PREREQUISITES
  • Understanding of vector mathematics, specifically Vector3 coordinates.
  • Familiarity with projectile motion and ballistic trajectories.
  • Basic knowledge of calculus for solving equations.
  • Experience with raycasting techniques in 3D environments.
NEXT STEPS
  • Research "Vector3 interpolation techniques" for smoother trajectory calculations.
  • Learn about "raycasting in Unity" or similar game engines for collision detection.
  • Study "ballistic trajectory equations" to enhance understanding of projectile motion.
  • Explore "advanced calculus applications" for solving complex motion equations.
USEFUL FOR

Game developers, particularly those working on physics simulations, 3D graphics programmers, and anyone involved in implementing projectile mechanics in gaming environments.

jschieck
Messages
2
Reaction score
0
i'm having trouble creating a arc for check for collision similar to a grenade launcher type weapon and am not very good at math :/

i have the player position and the target position, now i just need to check every so often (let's say .1 units) along the outside of my ellipse to see if my raycast has struck geometry.

so i have the 2 vector3's of position, and want the ellipse to scale on the Y axis based on the distance between them. some of it i can figure out but just don't know math well enough.

can someone cast some light on the formula i might use? basically just looking for an array of all the points on an ellipse every .1 units
 
Physics news on Phys.org
Hi. Is it a problem of faking ballistic trajectories?

http://img193.imageshack.us/img193/8537/ballisticgraph2.png

\frac{x}{e}-d^x + 1

e is the ratio:

e = \frac{\sin(\alpha)}{\sin(45^{\circ})}

where α is the launch angle.

d scales the trajectory.

If you want the trajectory to be less sensitive to the value of d then use this:

\frac{x}{e}-d^{\frac{x}{10}} + 1

The other function is more complex but I think it looks better for it:

\frac{x}{e}-\sqrt{\frac{x}{2}^x}+ 1

http://img205.imageshack.us/img205/5281/ballisticgraph3.png

I think it looks like a missile trajectory, no?

You need to solve

\frac{x}{e}-d^{\frac{x}{10}} + 1 = 0

or

\frac{x}{e}-\sqrt{\frac{x}{2}^x} + 1 = 0

to find out where the projectile lands in either ballistic graph. Then you simply interpolate in the graph between 0 and where the projectile lands according to the distance to target you've have elapsed so far between the player and target positions.

However, there still remains the problem of varying the projectile's velocity.

Maybe a calculus guru can pitch in.
 
Last edited by a moderator:

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
18K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 7 ·
Replies
7
Views
3K