/usr/share/doc/colobot/html/graphics.html is in colobot-dev-doc 0.1.11-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Colobot: Graphics engine</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Colobot
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Graphics engine </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The graphics engine consists of 3 parts:</p><ul>
<li>core - low-level device code (currently with only OpenGL implementation)</li>
<li>main engine - managing and displaying 3D environment (terrain, models, water, sky, effects, camera, etc.)</li>
<li>2D interface - classes drawing the 2D interface (menus, buttons, editor, HUD elements)</li>
</ul>
<h1><a class="anchor" id="coords"></a>
Drawing coordinates</h1>
<h2><a class="anchor" id="coords2d"></a>
2D interface</h2>
<p>2D interface is drawn by setting orthogonal projection yielding the following 2D coordinate system:</p>
<div class="image">
<img src="2d_coord.png" alt="2d_coord.png"/>
</div>
<p>Depth test is disabled for 2D interface, so Z coordinates are irrelevant.</p>
<p>The coordinate system is constant and is independent of resolution or screen proportions.</p>
<p>UI elements are laid out by computing these standard coordinates, using 640x480 resoultion as reference. That is, their coordinates are computed like so: x = 32.0f/640.0f, y = 400.0f/480.0f.</p>
<h2><a class="anchor" id="coords3d"></a>
3D environment</h2>
<p>3D environment is drawn using the following coordinate system:</p>
<div class="image">
<img src="3d_canonical_coords.png" alt="3d_canonical_coords.png"/>
</div>
<p>The base coordinate system is like depicted above with viewport on Z=0 plane. The coordinates are then transformed by world, view and projection matrices to yield screen coordinates.</p>
<p>The base coordinates are also model coordinates. All models must be modelled in this setup. Scale should be kept proportional to existing models.</p>
<p>The world matrix defines the transformation from model coordinate system to the point and orientation in 3D scene. This matrix is defined one per every <em>graphics engine</em> object. (Note the emphasis - the objects as defined in game engine do not necessarily correspond to one graphics engine object.)</p>
<p>The view and projection matrices define the viewing point and volume, and are mostly managed by <a class="el" href="class_gfx_1_1_c_camera.html" title="Camera moving in 3D scene. ">Gfx::CCamera</a>. View is defined by <a class="el" href="namespace_math.html#ad923d2d0b9e3407a8e5ab2c6f5f00321" title="Loads view matrix from the given vectors. ">Math::LoadViewMatrix()</a> function, that is using 3 vectors: eye position (eyePt), target point (lookatPt) and up vector (upVec). Projection is always perspective, with changing view angle (focus). </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
|