Computational geometry in 3D games
Computational geometry in 3D games
Usually in video games, they use API for creating the 3D environment. Thanks to this API you can render a 3D geometry in an easy way.
These are the most common APIs:
-Vulkan
-Direct3D
-Direct X
-OpenGL
Normally all the APIs tend to use the same base for creating 3D Objects. All the 3D models are made by triangles, because every object can be split into triangles, but a triangle can only be split into other triangles. These triangles are called primitives. To create these triangles, first the position of all the vertices, in 3 dimensions, is saved in clockwise order, and also other information of these vertices could be stored. With this, it is possible to create primitive's elements. These following 6 are frequently used in the API of DirectX.
- Examples of 3D model in unreal engine
Point Lists
It is a list of independent points showed on screen. It has a lot of uses in video games, since creating a point of interest in a minimap to creating a star-filled sky.
Line list
It is a list of vertices which all of them are interconnected by a line.
Triangle list
It is a list of vertices where in groups of 3 they form an independent triangle.
Triangle Strips
It is a list of vertices that create interconnected triangles, making a surface.
Triangle Fans
It is the same as Triangle Strips, but the difference is that the triangles share the same vertex.
View Space
The View Space is a space where the camera is in the position (0,0,0) and focusing on the Z axis, this is needed to simplify the math. To calculate it, first you need the transformation matrix that changes the camera in world position to the position (0,0,0). Once you have it, you only need to get the inverse and multiply all the 3D Objects by this.
Projection Space
The Projection Space is the last space, it is the space that you are going to see on the screen, but before flattening the image, we need to know what part will be rendered in the image and what part will not. And it is done with the Projection Space, that is a space with all the axes in the range of -1 and 1. To transform the view matrix, to this matrix, we need a transformation matrix, and it depends on the projections that we want. The most common projections are Orthographic Projection and Perspective Projection.
- A level design in Orthographic and Perspective projection
External links
- Microsft Direct X, World Transform.
- Microsft Direct X, View Transform.
- Microsft Direct X, Projection Transform.
- Unreal Camera Perspective
Computational geometry in 3D games
This article "Computational geometry in 3D games" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Computational geometry in 3D games. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
