Dividing up 3d angles into equal quantities
Say you have a 2d object, you could easily divide this into 15 degree rotations by simply rotating around the centre in 15 degree increments.
If I want to calculate for a 3d object all the angles possible with equal spacing between each one how would I go about doing this.
although doing p*r*y for each would work it'd be fairly arbitrary and have a huge amount of overlap. I'd really like a quaternion solution too.
I'm doing this for a video game project I'm currently working on, essentially an old school flight sim which although 3d in game-play is rendered as 2d sprites. I'm looking for a simple way to 开发者_JAVA百科render all the possible angles of my aeroplane model procedurally with equally spaced angles including each orthogonal one.
There are various ways to do this; the solution isn't uniquely defined from the information given. Also note that the phrase "all possible angles" is misleading because there are infinite angles.
Nevertheless if by "3d angle" you literally mean a solid-angle (in units of steradians), then the platonic solids will divide the sphere into equal solid-angles. (Technically you want spherical polyhedra, but they're "almost" the same in the sense that we can take a polyhedral solution and "relax" it.)
Keeping in mind your condition that you want "[to include] each orthogonal [angle]" (that there should be some triplet of views which are orthogonal to each other), we are saddened to notice that there is only one platonic solid which satisfies this, namely the octahedron:
Sadly this would correspond to just taking the orthogonal views (and only those views). That would be boring and probably not what you intended to ask for. What you can do however is build upon this solution, and subdivide the octahedron. Here are two possibilities:
For each face in the octahedron, you could create a new view at the center of that face (stellate it). The result would be a view from each of the vertices as pictured in this 4-view origami (oddly the best picture I could find). Thus in addition to the orthogonal angles, you gain 8 angles between each axis, of the form
(±1,±1,±1)
. Keeps the number of views down to a manageable size.If you desire more views, you can do something like building a geodesic dome, except you start with an octahedron rather than an icosahedron. In the first example, we subdivide the triangular faces each into a "triforce" of subdivisive power, to obtain a "2-frequency octahedral geodesic sphere".
* original link
Algorithm: take the mathematical average of each adjacent vertex to produce the new vertices.
This may not perfectly divide the angles, but it will come fairly close. If you would like even more "equality" of solid angles, see the link for an example of a "3-frequency octahedral geodesic sphere".
Algorithm: To a first approximation, you can trisect an angle by taking the vectors (A+2B)/3
, or vice versa. If you furthermore seek extreme precision, rather than explicitly calculating the equations, you can use the solid-angle formula for a tetrahedron as a measure of accuracy, and perform a relaxation on your initial guess, where you slowly perturb the trisections towards or away from the origin.
Additionally the google search results are a bit mathematically dense, but you may be able to glean some use out of equal area spherical polyhedra.
精彩评论