2 Marks
2 Marks
In OpenGL, the gluLookAt function specifies a viewing transformation that defines the
position of the viewer, the direction the viewer is looking, and the up direction for the
viewer. The syntax for gluLookAt is as follows:
void gluLookAt(
GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ,
GLdouble centerX, GLdouble centerY, GLdouble centerZ,
GLdouble upX, GLdouble upY, GLdouble upZ
);
The eyeX, eyeY, and eyeZ parameters specify the position of the viewer, while the centerX,
centerY, and centerZ parameters specify the point that the viewer is looking at. The upX,
upY, and upZ parameters specify the up direction for the viewer.
For example, to specify a viewing transformation that places the viewer at the origin,
looking down the positive z-axis, with the y-axis as the up direction, you could call
gluLookAt like this:
gluLookAt(0, 0, 0, 0, 0, 1, 0, 1, 0);
In OpenGL, back face culling is controlled by the GL_CULL_FACE state. To enable back
face culling, you can call the glEnable function with the GL_CULL_FACE parameter:
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
This will cause all polygons with their normal vector pointing away from the viewer to be
culled, leaving only those facing the viewer to be rendered. You can also specify
GL_FRONT to cull polygons facing away from the viewer, or GL_FRONT_AND_BACK to disable
back face culling altogether.
3. List some applications of Computer Vision.
1. Image and video processing: Computer vision techniques are widely used to
process and analyze images and video, such as for object recognition, facial
recognition, and image enhancement.
2. Surveillance and security: Computer vision systems can be used to monitor and
track people and objects in real-time, and to detect suspicious activity or
potential threats.
3. Transportation: Computer vision is used in a variety of transportation
applications, such as autonomous vehicles, traffic monitoring and control, and
pedestrian and object detection for safety.
4. Medicine: Computer vision is being used to analyze medical images, such as
X-rays and CT scans, for diagnosis and treatment planning, as well as to assist in
surgery.
5. Agriculture: Computer vision is used to monitor crop health, detect pests and
diseases, and optimize irrigation and fertilization.
1. Non-player character (NPC) behavior: AI can be used to control the behavior and
actions of NPCs, such as enemies, allies, and civilian characters. For example,
NPC characters might use pathfinding algorithms to navigate around the game
world and avoid obstacles, or use decision-making algorithms to choose
appropriate actions in response to player actions or the state of the game.
2. Opponent intelligence: In games with competitive elements, AI can be used to
control the behavior of opponents, such as in turn-based strategy games or
real-time strategy games. Opponent AI might use machine learning algorithms to
learn from player actions and adapt its strategies over time.
3. Game world simulation: AI can be used to simulate and control the behavior of
elements in the game world, such as weather patterns, animal behaviors, and
physical phenomena.
4. Decision-making: AI can be used to help players make decisions by providing
recommendations or suggestions based on the current state of the game.
5. What is the role of process manager in game logic?
In game development, a process manager is a system that is responsible for managing
and executing processes or tasks that are part of the game logic.
The process manager is responsible for scheduling and prioritizing these tasks, as well
as handling dependencies between tasks and coordinating their execution.
The role of the process manager in game logic is to ensure that the game runs smoothly
and efficiently by organizing and executing the various processes and tasks that are
needed to update the game state and render the game world.
In perspective projection, the frustum is defined by the field of view (FOV) of the camera,
which determines the angle of the viewable area.
The FOV can be specified in terms of the vertical field of view (VFOV) or the horizontal
field of view (HFOV), depending on the aspect ratio of the viewport.
The frustum is used to determine which objects in the scene are visible from the
camera's perspective and should be rendered. Objects outside the frustum are clipped
and not rendered, which can improve performance by reducing the number of polygons
that need to be processed and drawn.
Heuristic planning algorithms are often used in AI applications such as robotics, natural
language processing, and computer games.
The transposition table is used to accelerate the search process by allowing the AI to
quickly retrieve partial search results for positions that have already been searched,
rather than starting the search from scratch. This can significantly reduce the time and
resources required to find a solution, especially in complex search problems with a large
search space.