Wrapping
Encyclopedia
In computing, wrapping is when a variable that exceeds its maximum value returns to its minimum value and vice-versa. Many high-level programming languages avoid wrapping by giving an arithmetic overflow
error
if this occurs.
Camera wrapping is a technique often used in video games, which allows a player to move in a straight line and get back to where they started. This was more often used in older games to make it seem that the player is moving up or down an extremely high hill; memory can be saved by using wrapping instead of creating a larger area filled with unpassable walls:
--\ \ \
\ \ \
\ \ \--
--\
\
\
\
\
\
\
\
\--
As the diagrams above show, using wrapping will reduce the size of the area needed.
Camera wrapping can also be used to simulate the surface of a cylinder
or torus
.
Arithmetic overflow
The term arithmetic overflow or simply overflow has the following meanings.# In a computer, the condition that occurs when a calculation produces a result that is greater in magnitude than that which a given register or storage location can store or represent.# In a computer, the amount by which a...
error
Error
The word error entails different meanings and usages relative to how it is conceptually applied. The concrete meaning of the Latin word "error" is "wandering" or "straying". Unlike an illusion, an error or a mistake can sometimes be dispelled through knowledge...
if this occurs.
Camera wrapping is a technique often used in video games, which allows a player to move in a straight line and get back to where they started. This was more often used in older games to make it seem that the player is moving up or down an extremely high hill; memory can be saved by using wrapping instead of creating a larger area filled with unpassable walls:
- With wrapping:
--\ \ \
\ \ \
\ \ \--
- Without wrapping:
--\
\
\
\
\
\
\
\
\--
As the diagrams above show, using wrapping will reduce the size of the area needed.
Camera wrapping can also be used to simulate the surface of a cylinder
Cylinder (geometry)
A cylinder is one of the most basic curvilinear geometric shapes, the surface formed by the points at a fixed distance from a given line segment, the axis of the cylinder. The solid enclosed by this surface and by two planes perpendicular to the axis is also called a cylinder...
or torus
Torus
In geometry, a torus is a surface of revolution generated by revolving a circle in three dimensional space about an axis coplanar with the circle...
.