Hot answers tagged

2

When you have 2d sprites in a 3d environment, they work like two-dimensional planes. Think of them as cardboard-cutouts which are moving through the world. When you want to rotate these cardboard cutouts to always face the camera, then the search term you are looking for is "Billboarding". It can be implemented by attaching this MonoBehaviour to it: using ...


1

I'm not currently at my computer to show a valid demonstration, however, I've used "Camera.main.ScreenPointToRay(Input.mousePosition)" casting that ray and referencing the point that it hits. You could set that point to be the position that your character looks at via Vector3.lookToward(). Also,you are correct, this would work regardless of camera angle as ...


1

I can think of two reasons: if your quats represent infinitesimal rotations, adding them together actually yields the composite rotation, provided the result is infinitesimal too (i.e. an element of that algebraic group). Quaternion addition, as opposed to multiplication, is commutative and, well, numerically fast. One situation where this might be "a ...


1

I would recommend you to place the 2d sprite not in the game world but instead place it on a UI canvas with "Screen Space - Overlay" mode. You can convert the game-world position of a GameObject to screen-coordinates using Camera.WorldToScreenPoint. Then you need to convert the screen coordinates to canvas coordinates and place your sprite there. Code ...


1

I'd like to point you to the work of J. van de Berg et al. on Optimal Reciprocal Collision Avoidance. http://gamma.cs.unc.edu/ORCA/ In their paper, they provide the mathematics and algorithm outline on how to solve the problem you state in an optimal way using randomized linear programming. Best of luck :).


1

I don't think there's an efficient way of solving the problem exactly, but here's how I'd try to tackle it. First, I'd use bounding volumes around each object, instead of the objects themselves. Each object can be approximated by the union of more than one bounding volume, though. The simplest solution would be to compute a single bounding volume that ...



Only top voted, non community-wiki answers of a minimum length are eligible