Questions tagged [mathematics]
Mathematics questions deal with the arithmetic, geometry, calculus, formulae and other calculations used in the development of a game.
2,026 questions
0
votes
0
answers
107
views
How do I render points in 3d space given spherical coordinates?
I have a 3d renderer I'm working on, and I need to know how the specific details of the human eye so I can project that to a coordinate, what is the math that does this given spherical coordinates and ...
1
vote
1
answer
251
views
How to speed up collision detection if there are hundreds of objects?
Let's say I have like 500 Asteroids and I'm using SAT to determine whether a collision with the Spaceship object has happened. This would require an insane amount of CPU cycles, so it makes sense to ...
3
votes
2
answers
136
views
Number system with restricted set of sequence configurations
I am trying to design a novel number system for a game.
To do this, I want to create a mapping from a set S of symbols to the integers, where not all sequences of symbols from S are allowed, but they ...
1
vote
0
answers
45
views
What is the best way to move a mask in a shader in a square path in Unity Shader Graph?
I would like to make the square move strictly along a square trajectory. The square will later be used to mask the main sprite.
How to achieve this result? How to move the square along the square's ...
1
vote
1
answer
125
views
Two Point Alignment Transformations
I'm trying to determine the transformation steps (position, scale, rotation) needed to be applied to an object so that two points, locally positioned in that object, line up with two world space ...
0
votes
1
answer
144
views
Slot reels RTP(return to player) estimation
I am making a slot game with 3 x 5 reels. The RTP I am targeting is 99%. My reel data is given as (yaml):
...
0
votes
0
answers
77
views
Projecting 3D gaussian's transform matrix to a 2D viewspace transform matrix
Essentially I'm wanting to project:
A 3D transformation matrix of a Gaussian (or in this case for simplicity a unit sphere) that includes scale, rotation and translation in world space TO
A 2D ...
1
vote
1
answer
577
views
Given two points (A and B), how can I obtain a point a set distance along the line between them?
Let's say I have position A, that is (0,0) and Position B that is (10,5).
Now let's say I know that position C is 5 units' distance from position A in direction to Position B.
Provided that the ...
2
votes
1
answer
185
views
How to adapt the Anya any-angle pathfinding algorithm to handle non-discrete start/target positions?
Recently, I have been investigating the Anya pathfinding algorithm.
Anya is an optimal any-angle pathfinding algorithm.
However, it works only with discrete points on the grid.
Here is an excerpt from ...
0
votes
1
answer
126
views
How to Rotate a Sphere around a Tilted Axis in a 3D space
I'm developing a game with Unreal Engine 5.4.4.
In the game, I'm trying to rotate a sphere around its Z axis. If I put the sphere on the map and add a rotation around its Z axis is easy.
I only have ...
0
votes
1
answer
156
views
Resizing a Sprite in 3D space to match its native pixel size at a target screen resolution?
I am placing a 3D game object with a SpriteRenderer + Billboard attached to it in my scene.
However, since it's a distance away from a perspective camera, the sprite gets scaled, losing a lot of the ...
0
votes
0
answers
49
views
How to calculate the Number of blocks per column in an N step pyramid?
Designing a space game, where each ship has a certain size/ number of layers of armor.
for example 3 layers size 7.. .Which would look like this:
...
0
votes
1
answer
151
views
Shrink a Circle's Radius Without Deformation Until It's a Solid Spot
I need to shrink the radius of a ring without deforming it by shrinking it's outline(the way scaling it would).
I need to do this until the hollow fill is gone and its a solid spot.
Here's an example:
...
0
votes
1
answer
121
views
Post process effect with sphere mask is offset until the window is resized
I am having a weird issue with the position of my sphere mask. Here is what it looks like currently:
The white disc should be directly under the player character, not shifted off to the side.
...
0
votes
0
answers
41
views
How can I detect which slice of the pie chart my mouse is hovering over?
I'm trying to create a simple pie chart for my game (a strategy/simulation game) to show population demographic data for a province, but I'm struggling to figure out how to detect which slice is being ...