Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Mathematics questions deal with the arithmetic, geometry, calculus, formulae and other calculations used in the development of a game.
0
votes
Casting ray from 2D to 3D
Long ago I developed an multiprocessor raytracing renderer for an old supecomputer in my college.
I addressed this problem by defining an observation point and the screen plane in world coordinate. T …
1
vote
non-linear interpolation
What about Bézier curve? A segment is basically a first degree BC but you can construct second or superior degrees curves that are still segments. I suggest to you to use a cubic BC having the two con …
12
votes
Accepted
Moving a particle around an Archimedean spiral at a constant speed
Let's complicate your spiral:
be
in your case f(t) := t, in mine f(t) := 1 (so i pay back my complications with simplifications :)
If you want to go at a certain speed in this degenerate spiral (a …
2
votes
Generate a range of number with X being returned most of the time
Talking about percentage, you can generate an integer number from 0 to 99 than subdivide your 100% into chunks of different sizes:
| 10 | 10 | 20 | 30 | 30 |
1 5 2 …
4
votes
Do I need the 'w' component in my Vector class?
The fourth dimension in 3D vector is used to compute the affine transformations that will be impossible to compute using matrixes alone. The space remains three-dimensional so this mean that the fourt …
0
votes
How do I get AI Agents to move along a curve?
The path finder should give you the path and you should not modify that. I belive that it is possible to modify your path finder algorithm to take into account that path with sharp turns are wrose tha …
1
vote
What should be taken into consideration when choosing a math library for games?
The library should not be a problem for your project. If it is your case that means that you are coupling your system with a library: this generally is not good idea. What if another better library em …
0
votes
Find a unit vector exactly halfway between two connected line segments
Let A and B be your vectors:
The summing vectors do not need to be unit vectors but simply equal in length so, if |A| >= |B|, you can:
which is more numerically stable since you have only a frac …
10
votes
What does the graphics card do with the fourth element of a vector as the final position?
Tring to answer to the appropriate comment of Natan, I did some consideration that can be useful to understand what really happens when you use vectors in Affine Space to represent 3D vectors in the s …
8
votes
How to quickly calculate the sight area in a 2D tiled game?
I'd rather cast shadow rays instead of line of sight rays.
Let's say this is your view area (the potentially visible area)
######################
#####.............####
###................###
##.... …
6
votes
Accepted
Getting the angle between two objects?
That vector can be obtained simply by summing up the normals of the boxes faces and normalize. The normal vector even point outside the box so the sum vector points toward the direction where the boxe …
15
votes
Accepted
Projected trajectory of a vehicle?
If you can vary your speed (thus your angle of steer) you will always find a solution, starting from the degenerate one where the entity is almost stopped rotating in a little circle until pointing th …
20
votes
Accepted
Circle-Line Collision Detection Problem
The segment running from A to B can be computed as
P(t) = A + D · t where D is B - A and t runs from 0 to 1
Now the circle is centered on the origin (move A and B if necessary to put the center in …
1
vote
How could you parallelise a 2D boids simulation
I'm assuming yours is a toroidal system, you can partition to the space so each unit has its sub area.
At each step the particles are moved, the particles that goes out the sub area are sent to the r …