How Can I Rotate Ellipsoids for Accurate Hitbox Detection in a FPS Game?

Click For Summary
SUMMARY

The discussion focuses on the implementation of ellipsoids for hitbox detection in a First Person Shooter (FPS) game engine being developed by a Computer Science and Mathematics student at Winthrop University. The user aims to replace rectangular prisms with ellipsoids for smoother collision detection but encounters challenges when rotating these ellipsoids based on a unit vector representing the character's facing direction. Suggestions include expressing the ellipsoids in spherical coordinates and parameterizing the angles, specifically using the function ψ(θ, φ) = (2r cos(φ) cos(θ), 3r cos(φ) sin(θ), sin(φ)). The user seeks clarification on the mathematical implementation of this approach.

PREREQUISITES
  • Understanding of 3D geometry and transformations
  • Familiarity with spherical coordinate systems
  • Knowledge of vector mathematics
  • Experience with game development concepts, particularly hitbox mechanics
NEXT STEPS
  • Research spherical coordinate transformations in 3D space
  • Study parameterization techniques for ellipsoids in game engines
  • Explore collision detection algorithms specific to FPS games
  • Learn about quaternion rotations for smoother object orientation
USEFUL FOR

This discussion is beneficial for game developers, particularly those focused on physics and collision detection in FPS games, as well as students and professionals interested in advanced 3D mathematics and its applications in game design.

Lazyshot
Messages
5
Reaction score
0
A little background first is that I'm currently a rising Sophomore at Winthrop University in South Carolina. I am a Computer Science and Mathematics Double Major. After finishing half-way through third semester calculus and dealing with 3-Dimensional space, vectors, planes, and surfaces, I really loved it. I decided to mold my two majors and create a video game engine, primarily First Person Shooter. Anyway, back to my question:

In order to detect bullet and model collision, I am going to create Hitboxes like counter-strike. But instead of rectangular prisms I was going to use Ellipsoids for a smoother body. Anyway, But in order for this to work properly I would have to create a torso, head, arms, and legs. Understandable. Now, I have no problem creating the initial ellipsoids, because the origins are all fixed relative to the torso's origin. The problem is about when I want to rotate the body.

Other information is that I have a unit vector representing the facing direction of the body.

Anyone have any suggestions. I'm getting so frustrated that I feel like scrapping the whole thing.
 
Physics news on Phys.org
Could you express the ellipsoids in a spherical rather than cartesian co-ordinate system, and then parameterize the angles, so you have a parameterized function [tex]\psi(\theta,\varphi)=(2r\cos{\varphi}\cos{\theta}, 3r\cos{\varphi}\sin{\theta},\sin{\varphi})[/tex]
 
Last edited:
Well, for some reason, that maths didn't come out as I'd expected, maybe you can quote my post to see what I meant.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
14
Views
6K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
5K