Monday, 20 January 2014

HA4 Task 2 - Displaying 3D Polygon Animations

HA4 Task 2 - Displaying 3D Polygon Animations
How are 3D models displayed? Describe and explain what an API and a Graphics pipeline are.


Remember that you are trying to comprehensively explain the theory and applications of 3D with elucidated examples and consistently using subject terminology correctly.



API
API abbreviates Application Programming Interface. The API  is used in game engines and it specifies how software components will interact with each other. They are a set of programming instructions which establish tools and protocols for building software applications. The most common APIs are one provided by Microsoft called DirectX and another called OpenGL. These two APIs are quite good and offer all the 'building blocks' in which programmers can use to establish a product. The better the API, the easier it is for programmers to use it and better final products can be made.


DirectX
This is Microsofts own API. It is widely used in video game development for Windows, Xbox, Xbox 360 and Xbox One. DirectX is regularly updated, has tons of features and has the best performance. It is also supported by pretty much all 3D accelerator cards


http://en.wikipedia.org/wiki/DirectX


OpenGL
OpenGL was created by Silicon graphics and was released in 1992. It - just like DirectX - is also widely used in the video game industry for game development. It is said that OpenGL is easier to begin with, is cross platform and has a stable interface.

http://en.wikipedia.org/wiki/OpenGL
OpenGL logo


Graphics Pipeline
This refers to the steps used to create a 2D raster presentation of a 3D scene. This means that that once you have created a 3D model, the graphics pipeline is the process of turning that model into what the computer displays in a video game for example.

http://en.wikipedia.org/wiki/Graphics_pipeline

Stages of the Graphics pipeline

1. 3D Geometric Primitives
These are basic shapes such as cubes and spheres made out of triangles. These triangles are well suited to their purpose as they always exist on a single plane and will not bend the shape if a corner is lifted.

These are the basic 3D primative shapes:




This is how 3D shapes are made using triangular polygons (below). As you can see, these shapes are made of triangular planes with their vertices modified to form these shapes such as the Hexagon, however, you can use any shape of polygon you want - triangle is just the most stable. These shapes can be used to make objects or creatures for the game.


2. Modeling and Transformation
"Transform the local coordinate system to a 3D world". This means to take the object and transport it into a sort of 3D world that has its own coordinate system. The job here is to take a two dimensional piece of concept art and translate it into a 3D model.


http://3d.about.com/od/3d-101-The-Basics/tp/Introducing-The-Computer-Graphics-Pipeline.htm

3. Shading and Texturing
This is the stage where materials and textures are added to the model. As you can see from the picture above of the bike, all models will look like this at the start of this stage ( but obviously in different shapes). Now, we began to add colour and textures to the polygons. You can either place a texture onto the surface of a polygon which will engulf the polygon with that texture, or paint textures on yourself.

What is 3D Modeling ?


4. Lighting
Now lighting is added to make scenes come to life. This illuminates models and is able to create shadows in the necessary  areas to add realism and make it come to life. You can also experiment with different lighting to test what the model would look like in scene in areas with different light levels. For example, if the scene was set at sunset, you could adjust the light respectively and test how the model would look with the sun facing nearly horizontally at the model. As you can see from the image below, the lighting is set to the west as there are shadows on the right of the house. This makes the house look more realistic.




5. Projection transformation
"Transform the 3d world coordinates into the 2d view of the camera, for instance the object the camera is centered on would be in the center of the 2d view of the camera. In the case of a Perspective projection, objects which are distant from the camera are made smaller. This is achieved by dividing the X and Y coordinates of each vertex of each primitive by its Z coordinate (which represents its distance from the camera). In an orthographic projection, objects retain their original size regardless of distance from the camera."
This is also positioning and setting down the camera in the desired position you would like it to be in the scene.



6. Animation and clipping.
Clipping is where any objects that are not seen in the viewing camera are'clipped'. This means they are temporarily removed from the scene until they can be seen by the camera. For example, in a city, there will be a lot of shader, textures and models that will not be seen depending on the angle of the camera and the distance, so they are clipped and this increases the programs speed.

Animation is then created which breathes even more life into the scene by adding movement. This could be movement of creatures for example. These models are controlled by a virtual skeleton and parts are manipulated to convey movement. This can be done by 'pose-to-pose' where the animator will create the creature standing in a stance, add frames and over the next series of frames, will keep adding the same stance as the previous but change arm movements for example to show the character waving.



7. Rasterization and rendering 
Rasterization is where the 2D image space representation of the scene is changed into a raster format where pixel values are created, so every pixel will be given the colour it is supposed to be in the scene. Rendering is where everything comes together and renders into a 2D image. This finalized image could be animated or just a still image, but lighting, textures, models and animation information will be brought together and each pixels postion and time will be determined to create a final rendered and rasterized image.



http://3d.about.com/od/3d-101-The-Basics/a/Rendering-Finalizing-The-3d-Image.htm


No comments:

Post a Comment