Game Development Reference
In-Depth Information
3 . Typically, there is a known 2D screen space position that a waypoint ar-
row should always be at. However, because the arrow is actually a 3D ob-
ject, we need the correct world space position to draw it. The way to de-
termine this is to take the 2D screen space position and unproject it, which
will yield the appropriate 3D position.
4 . In order to calculate the axis and angle of rotation for the waypoint arrow,
we first must construct a vector from the 3D player to the waypoint. Once
this vector is normalized, we can use the dot product between the new
vector and the original facing vector to get the angle of rotation. Similarly,
the cross product can be used to calculate the axis of rotation.
5 . The aiming reticule is always at a 2D point on the screen. We take this 2D
point and perform two unprojections: one at the near plane and one at the
far plane. The code can then construct a ray cast between these two points,
and check to see the first object this ray cast intersects with. If it's an en-
emy, the reticule should be red, and if it's a friendly, it should be green.
6 . In order to take a 3D coordinate and convert it into a 2D one for the radar,
we ignore the height component. In a y-up world, this means we create a
2D vector that uses the x-component and the z-component of the 3D vec-
tor.
7 . Absolute coordinates are a specific pixel location on screen, whereas rel-
ative coordinates are relative either to a key point on the screen (such as
the center or the corners) or to another UI element.
8 . Hard-coding UI text makes it difficult for nonprogrammers to change the
text in development. Furthermore, hard-coded text cannot be easily local-
ized. This is why text should be stored in external text files.
9 . The ASCII character set can only display English letters. The Unicode
character set solves this problem in that it supports many different writing
systems, including Arabic and Chinese. The most popular Unicode repres-
entation is UTF-8, which is a variable-width encoding for characters.
10 . User experience refers to the reaction a user has as he or she is using an
interface. A well-designed game UI should have a positive user experien-
ce.
Search WWH ::




Custom Search