Working
This commit is contained in:
+40
-22
@@ -20,7 +20,7 @@ A 3D model encoded in the OBJ format typically consists in two files: the materi
|
||||
The material file declares all the materials that the object file will reference.
|
||||
A material consists in name, and other photometric properties such as ambient, diffuse and specular colors, as well as texture maps, which are images that are painted on faces.
|
||||
Each face corresponds to a material.
|
||||
A simple material file is visible on Snippet X. // TODO
|
||||
A simple material file is visible on @cubemtl.
|
||||
|
||||
The object file declares the 3D content of the objects.
|
||||
It declares vertices, texture coordinates and normals from coordinates (e.g. `v 1.0 2.0 3.0` for a vertex, `vt 1.0 2.0` for a texture coordinate, `vn 1.0 2.0 3.0` for a normal).
|
||||
@@ -35,28 +35,46 @@ Faces are declared by using the indices of these elements. A face is a polygon w
|
||||
An object file can include materials from a material file (`mtllib path.mtl`) and apply the materials that it declares to faces.
|
||||
A material is applied by using the `usemtl` keyword, followed by the name of the material to use.
|
||||
The faces declared after a `usemtl` are painted using the material in question.
|
||||
An example of object file is visible on Snippet X. // TODO
|
||||
An example of object file is visible on @cube.
|
||||
|
||||
// \begin{figure}[th]
|
||||
// \centering
|
||||
// \begin{subfigure}[c]{0.4\textwidth}
|
||||
// \lstinputlisting[
|
||||
// language=XML,
|
||||
// caption={An object file describing a cube},
|
||||
// label=i:obj,
|
||||
// ]{assets/introduction/cube.obj}
|
||||
// \end{subfigure}\quad%
|
||||
// \begin{subfigure}[c]{0.4\textwidth}
|
||||
// \lstinputlisting[
|
||||
// language=XML,
|
||||
// caption={A material file describing a material},
|
||||
// label=i:mtl,
|
||||
// ]{assets/introduction/materials.mtl}
|
||||
// \includegraphics[width=\textwidth]{assets/introduction/cube.png}
|
||||
// \captionof{figure}{A rendering of the cube}
|
||||
// \end{subfigure}
|
||||
// \caption{The OBJ representation of a cube and its render\label{i:cube}}
|
||||
// \end{figure}
|
||||
#figure(
|
||||
grid(
|
||||
columns: (1fr, 0.2fr, 1fr),
|
||||
align(center + horizon)[
|
||||
#figure(
|
||||
align(left,
|
||||
raw(
|
||||
read("../assets/introduction/cube.obj"),
|
||||
block: true,
|
||||
)
|
||||
),
|
||||
caption: [An object file describing a cube]
|
||||
)<cubeobj>
|
||||
],
|
||||
|
||||
[],
|
||||
|
||||
align(center + horizon)[
|
||||
#figure(
|
||||
align(left,
|
||||
raw(
|
||||
read("../assets/introduction/materials.mtl"),
|
||||
block: true,
|
||||
)
|
||||
),
|
||||
caption: [A material file describing a material]
|
||||
)<cubemtl>
|
||||
|
||||
#figure(
|
||||
align(left,
|
||||
image("../assets/introduction/cube.png", width: 100%)
|
||||
),
|
||||
caption: [A rendering of the cube]
|
||||
)
|
||||
],
|
||||
),
|
||||
caption: [The OBJ representation of a cube and its render]
|
||||
)<cube>
|
||||
|
||||
== Rendering a 3D model
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ When it comes to 3D streaming systems, we need two kind of software.
|
||||
|
||||
== JavaScript
|
||||
|
||||
=== THREE.js
|
||||
#heading(level: 3, numbering: none)[THREE.js]
|
||||
|
||||
On the web browser, it is now possible to perform 3D rendering by using WebGL.
|
||||
However, WebGL is very low level and it can be painful to write code, even to render a simple triangle.
|
||||
@@ -37,7 +37,7 @@ A snippet of the basic usage of these classes is given in @three-hello-world.
|
||||
caption: [A THREE.js _hello world_]
|
||||
)<three-hello-world>
|
||||
|
||||
=== Geometries
|
||||
#heading(level: 3, numbering: none)[Geometries]
|
||||
|
||||
Geometries are the classes that hold the vertices, texture coordinates, normals and faces.
|
||||
THREE.js proposes two classes for handling geometries:
|
||||
@@ -49,7 +49,7 @@ THREE.js proposes two classes for handling geometries:
|
||||
|
||||
In this section, we explain the specificities of Rust and why it is an adequate language for writing efficient native software safely.
|
||||
|
||||
=== Borrow checker
|
||||
#heading(level: 3, numbering: none)[Borrow checker]
|
||||
|
||||
Rust is a system programming language focused on safety.
|
||||
It is made to be efficient (and effectively has performances comparable to C // TODO \footnote{\url{https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/rust.html}} or C++\footnote{\url{https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/rust-gpp.html}})
|
||||
@@ -142,7 +142,7 @@ The borrow checker may seem like an enemy to newcomers because it often rejects
|
||||
It is probably for those reasons that Rust is the _most loved programming language_ according to the Stack Overflow
|
||||
Developer Survey // TODO in~\citeyear{so-survey-2016}, \citeyear{so-survey-2017}, \citeyear{so-survey-2018} and~\citeyear{so-survey-2019}.
|
||||
|
||||
=== Tooling
|
||||
#heading(level: 3, numbering: none)[Tooling]
|
||||
|
||||
Moreover, Rust comes with many programs that help developers.
|
||||
- #link("https://github.com/rust-lang/rust")[*`rustc`*] is the Rust compiler. It is comfortable due to the clarity and precise explanations of its error messages.
|
||||
@@ -152,7 +152,7 @@ Moreover, Rust comes with many programs that help developers.
|
||||
- #link("https://github.com/rust-lang/rustfmt")[*`rustfmt`*] auto formats code.
|
||||
- #link("https://github.com/rust-lang/rust-clippy")[*`clippy`*] is a linter that detects unidiomatic code and suggests modifications.
|
||||
|
||||
=== Glium
|
||||
#heading(level: 3, numbering: none)[Glium]
|
||||
|
||||
When we need to perform rendering for 3D content analysis or for evaluation, we use the #link("https://github.com/glium/glium")[*`glium`*] library.
|
||||
Glium has many advantages over using raw OpenGL calls.
|
||||
@@ -163,7 +163,7 @@ Its objectives are:
|
||||
- to be fast: the binary produced use optimized OpenGL functions calls;
|
||||
- to be compatible: glium seeks to support the latest versions of OpenGL functions and falls back to older functions if the most recent ones are not supported on the device.
|
||||
|
||||
=== Conclusion
|
||||
#heading(level: 3, numbering: none)[Conclusion]
|
||||
|
||||
In our work, many tasks will consist in 3D content analysis, reorganization, rendering and evaluation.
|
||||
Many of these tasks require long computations, lasting from hours to entire days.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#import "../chapter.typ"
|
||||
|
||||
#chapter.chapter[Foreword]
|
||||
|
||||
#include "3d-model.typ"
|
||||
#include "video-vs-3d.typ"
|
||||
#include "implementation.typ"
|
||||
|
||||
Reference in New Issue
Block a user