3
votes
Accepted
X axis intersection with inverted Y axis coordinates
This is way too complicated.
Let's say the screen center is at (0,0), the asteroid coords are x,...
2
votes
How to find the mathematical relationship between 2 variables?
The same strategy I explained in this answer I showed you works here too.
Take your table of numbers and paste them into a spreadsheet. (I used Google Sheets for this example)
Select the two columns ...
2
votes
Accepted
reposition object in circle
For circle p2 and p3 to be close enough to eachother to touch, we know that the distance between them must be ...
2
votes
Accepted
How to sort leaderboards, given wins and total games played?
One option is to add a constant to both values:
RankScore = (Wins + Inertia) / (Total + 2 * Inertia)
I called this constant "Inertia" because it creates ...
2
votes
Accepted
Finding the position of a point based on a relative point inside a quad
Assuming that your quad is convex, you can solve for an interior point using a few linear interpolations (lerps) between the corner points of the quad.
To illustrate, consider finding a point (R for ...
1
vote
Rotate an object relative to the player to face another object
The relative distance between the shield and the player is a fixed length instead of a fixed offset. Record this fixed length and calculate the position according to the rotation.
...
1
vote
Predicting Inclines and Declines for projectiles
Thanks to @DMGregory, they guided me in the right direction and I got it done. Briefly, what I did is this:
Every time a new map is created, I also create a heightmap (a 2D array containing all ...
1
vote
Finding the position of a point based on a relative point inside a quad
Find the points on the four sides according to the proportion, and then find the intersection of the two segments.
Code:
...
1
vote
Accepted
Matrix math: How to specify camera distance so that an object with a given size is completely visible?
If your field of view is measured from the bottom of the frustum to the top, then at a distance d your frustum is h units tall, where:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mathematics × 1874unity × 210
physics × 196
vector × 182
3d × 165
c# × 153
2d × 142
rotation × 133
opengl × 132
algorithm × 127
matrix × 126
geometry × 122
c++ × 111
collision-detection × 91
java × 87
javascript × 73
camera × 70
linear-algebra × 65
quaternion × 64
transformation × 63
xna × 60
game-design × 57
movement × 52
trigonometry × 48
coordinates × 46