Hot answers tagged math
10
Script one (or two or three) bouncing paths for the ball to follow. Adjust the rotation of your wheel model to cause the correct slot to land underneath the ball's final destination.
A bouncing path: construct complex animations made from many small movements of the ball over time, such that it appears to be natural physical motion around the structure of ...
4
In light of your question's context, http://nodewar.com/, there are a couple specific considerations for your solution:
You have a (low) maximum angular velocity, and enough maximum torque to reach it in very short time.
Your drone and target each have velocity and external acceleration unrelated to thrust (gravitation abounds).
Your desired target changes ...
4
If your matrix and quaternion classes are functioning properly, then a sequence of rotations should not ever give you a reflection (inverting or flipping a sprite). You should not just sweep the problem under the rug by writing code to flip something if it comes out with a reflection; you should try to figure out the actual problem.
That being said, based ...
4
After some more research I found out it's a Pinhole Camera Model. It is supposed to model a real camera.
There is a nice description here:
http://www.epixea.com/research/multi-view-coding-thesisse8.html
What I was having trouble understanding was that I need some sort of projection plane. If there is no projection plane, all pixels would basically meet in ...
3
Depending on the circumstances in some physics engines it may happen that two objects that overlap in one frame, and has their collision resolved, still overlap in the next frame. If they therefore have their collision resolved again it will typically reverse the original collision, resulting in the objects getting stuck together as they spend every second ...
3
It is a perspective projection, but those elements alone do not define the field of view.
This article covers more of the basics of the components of a projection. http://msdn.microsoft.com/en-us/library/aa916436.aspx
3
A similar question, with some good answers, including the apparent name of this whole subject, "motion planning":
http://stackoverflow.com/questions/2560817/2d-trajectory-planning-of-a-spaceship-with-physics
As a programmer, I like the practicality of user470365's suggestion. However, I'll take a stab at a more rigorous approach. My suggestion here computes ...
2
This is somewhat simple. When working with quaternions, to alter the rotation you multiply the current orientation with the change you want to apply. Now there are two ways to to do it:
result = orig * change
and
result = change * orig
The nice thing about this is that the one rotates it in the local coordinate system and the other rotates it in the ...
2
Calculate the path in background, and then change the numbers when you render it.
Calculate a path based on random parameters, but do this invisible to the player. You now know on which field the ball will land. Then you render it visible, but before you do that you rotate the texture of the roulette wheel so that the field where the ball will land shows ...
1
Your understanding of the article seems correct, it is explaining a process of superimposing 4 separate height maps onto each other to represent surface displacement with water. You could write it as four separate loops if you wanted, but why not condense it into a single loop that accesses each of the four height maps each iteration?
1
How can I calculate intersection with my scene geometries?
it varies depending on your performance needs and scene size, there are different approaches the easiest one is checking ray intersection with all bounding volumes containing geometry in the scene, however this may not be good enough if your scene is huge, or you have limited computational ...
1
You know the length going from the red line to the top of the blue line, right? Then you can apply some basic trigonometry.
The blue line and the red line are the legs of a right triangle. Your desired line from the camera to the red line in the direction of the raycast is the triangle's hypotenuse (origin at the camera):
Given an angle, theta between the ...
1
You can use Physics.SphereCast instead of RayCast.
This allow you to perform queries of the intersection of a sphere sweeped along a given direction instead of single ray, allowing a more tolerant collision detection.
Assign at least two different layers to the plane and the GameObjects under it, in order to exclude the plane from the query.
1
TokPhobia's answer contains the seed of a good idea, but the arithmetic average he recommends only gives the right answer if the price is a linear function of the amount of available units.
If the price is a non-linear function of availability, the correct price can instead be obtained by integrating the per-unit price from the amount available before the ...
1
I tackled this problem recently using some of these answers as a starting point. The most helpful thing to keep in mind is that boids are a sort of simple n-body simulation: each boid is a particle that exerts a force on its neighbors.
I found the Linde paper difficult to read; I suggest instead looking at S.J. Plimpton's "Fast Parallel Algorithms for ...
Only top voted, non community-wiki answers of a minimum length are eligible


